home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Games / Mac Game Developer's Handbook / Graphics / Time Space and CopyBits < prev    next >
MacBinary  |  1993-04-22  |  120.4 KB  |  [ONLN/HLX2]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Thu Apr 22 00:58:27 1993, modified Thu Apr 22 00:58:34 1993, creator 'HLX2', type 'ONLN', 121337 bytes "Time Space and CopyBits" , at 0x1da79 1682 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[ONLN]
macFileCreator[HLX2]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 17 54 69 6d 65 20 53 | 70 61 63 65 20 61 6e 64 |..Time S|pace and|
|00000010| 20 43 6f 70 79 42 69 74 | 73 00 00 00 00 00 00 00 | CopyBit|s.......|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 01 d9 f9 00 | 00 06 92 a7 fb d6 73 a7 |........|......s.|
|00000060| fb d6 7a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..z.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 f7 1b 00 00 |........|........|
|00000080| 4f 66 20 54 69 6d 65 20 | 61 6e 64 20 53 70 61 63 |Of Time |and Spac|
|00000090| 65 20 61 6e 64 20 5f 43 | 6f 70 79 42 69 74 73 0d |e and _C|opyBits.|
|000000a0| 49 6d 61 67 69 6e 67 09 | 4d 2e 49 4d 2e 54 69 6d |Imaging.|M.IM.Tim|
|000000b0| 65 53 70 61 63 65 43 6f | 70 79 42 69 74 73 0d 57 |eSpaceCo|pyBits.W|
|000000c0| 72 69 74 74 65 6e 20 62 | 79 3a 09 46 6f 72 72 65 |ritten b|y:.Forre|
|000000d0| 73 74 20 54 61 6e 61 6b | 61 09 4a 75 6e 65 20 31 |st Tanak|a.June 1|
|000000e0| 39 39 30 0d 54 68 69 73 | 20 54 65 63 68 6e 69 63 |990.This| Technic|
|000000f0| 61 6c 20 4e 6f 74 65 20 | 64 65 73 63 72 69 62 65 |al Note |describe|
|00000100| 73 20 74 68 65 20 76 61 | 72 69 6f 75 73 20 66 61 |s the va|rious fa|
|00000110| 63 74 6f 72 73 20 74 68 | 61 74 20 63 61 6e 20 69 |ctors th|at can i|
|00000120| 6e 66 6c 75 65 6e 63 65 | 20 74 68 65 20 73 70 65 |nfluence| the spe|
|00000130| 65 64 20 6f 66 20 5f 43 | 6f 70 79 42 69 74 73 20 |ed of _C|opyBits |
|00000140| 73 6f 20 74 68 61 74 20 | 64 65 76 65 6c 6f 70 65 |so that |develope|
|00000150| 72 73 20 63 61 6e 20 73 | 65 74 20 75 70 20 63 6f |rs can s|et up co|
|00000160| 6e 64 69 74 69 6f 6e 73 | 20 74 6f 20 61 63 68 69 |nditions| to achi|
|00000170| 65 76 65 20 74 68 65 20 | 62 65 73 74 20 70 65 72 |eve the |best per|
|00000180| 66 6f 72 6d 61 6e 63 65 | 20 66 6f 72 20 74 68 65 |formance| for the|
|00000190| 20 70 61 72 74 69 63 75 | 6c 61 72 20 73 69 74 75 | particu|lar situ|
|000001a0| 61 74 69 6f 6e 2e 0d 43 | 61 6e 20 59 6f 75 20 49 |ation..C|an You I|
|000001b0| 6e 66 6c 75 65 6e 63 65 | 20 74 68 65 20 53 70 65 |nfluence| the Spe|
|000001c0| 65 64 20 6f 66 20 5f 43 | 6f 70 79 42 69 74 73 3f |ed of _C|opyBits?|
|000001d0| 0d 5f 43 6f 70 79 42 69 | 74 73 20 68 61 73 20 6e |._CopyBi|ts has n|
|000001e0| 65 76 65 72 20 62 65 65 | 6e 20 61 6e 20 d2 65 61 |ever bee|n an .ea|
|000001f0| 73 79 d3 20 51 75 69 63 | 6b 44 72 61 77 20 72 6f |sy. Quic|kDraw ro|
|00000200| 75 74 69 6e 65 2c 20 6c | 69 6b 65 20 5f 4c 69 6e |utine, l|ike _Lin|
|00000210| 65 54 6f 20 6f 72 20 65 | 76 65 6e 20 5f 4f 70 65 |eTo or e|ven _Ope|
|00000220| 6e 50 6f 72 74 2e 20 20 | 4d 6f 73 74 20 70 72 6f |nPort. |Most pro|
|00000230| 67 72 61 6d 6d 65 72 73 | 20 77 68 6f 20 61 72 65 |grammers| who are|
|00000240| 20 6a 75 73 74 20 62 65 | 67 69 6e 6e 69 6e 67 20 | just be|ginning |
|00000250| 74 6f 20 61 64 6a 75 73 | 74 20 74 68 65 6d 73 65 |to adjus|t themse|
|00000260| 6c 76 65 73 20 74 6f 20 | 74 68 65 20 4d 61 63 69 |lves to |the Maci|
|00000270| 6e 74 6f 73 68 20 75 73 | 75 61 6c 6c 79 20 68 61 |ntosh us|ually ha|
|00000280| 76 65 20 74 6f 20 67 69 | 76 65 20 5f 43 6f 70 79 |ve to gi|ve _Copy|
|00000290| 42 69 74 73 20 61 20 66 | 65 77 20 74 72 69 65 73 |Bits a f|ew tries|
|000002a0| 20 62 65 66 6f 72 65 20 | 74 68 65 20 72 69 67 68 | before |the righ|
|000002b0| 74 20 62 69 74 73 20 63 | 6f 70 79 20 74 6f 20 74 |t bits c|opy to t|
|000002c0| 68 65 20 72 69 67 68 74 | 20 70 6c 61 63 65 73 2e |he right| places.|
|000002d0| 20 20 45 76 65 6e 20 6d | 61 6e 79 20 77 68 6f 20 | Even m|any who |
|000002e0| 66 65 65 6c 20 74 68 61 | 74 20 74 68 65 79 20 68 |feel tha|t they h|
|000002f0| 61 76 65 20 62 65 63 6f | 6d 65 20 4d 61 63 69 6e |ave beco|me Macin|
|00000300| 74 6f 73 68 20 70 72 6f | 67 72 61 6d 6d 65 72 73 |tosh pro|grammers|
|00000310| 20 73 74 69 6c 6c 20 73 | 65 65 20 72 65 66 6c 65 | still s|ee refle|
|00000320| 63 74 69 6f 6e 73 20 69 | 6e 20 74 68 65 69 72 20 |ctions i|n their |
|00000330| 6d 6f 6e 69 74 6f 72 73 | 20 6f 66 20 66 75 72 72 |monitors| of furr|
|00000340| 6f 77 73 20 62 65 74 77 | 65 65 6e 20 74 68 65 69 |ows betw|een thei|
|00000350| 72 20 65 79 65 62 72 6f | 77 73 20 61 73 20 74 68 |r eyebro|ws as th|
|00000360| 65 79 20 62 65 67 69 6e | 20 74 6f 20 70 72 65 73 |ey begin| to pres|
|00000370| 73 20 74 68 65 20 6b 65 | 79 20 6c 61 62 65 6c 6c |s the ke|y labell|
|00000380| 65 64 20 d2 43 2e d3 0d | 5f 43 6f 70 79 42 69 74 |ed .C...|_CopyBit|
|00000390| 73 20 69 73 20 6f 6e 65 | 20 6f 66 20 74 68 6f 73 |s is one| of thos|
|000003a0| 65 20 72 6f 75 74 69 6e | 65 73 20 74 68 61 74 20 |e routin|es that |
|000003b0| 69 73 20 73 6f 20 66 75 | 6c 6c 20 6f 66 20 73 75 |is so fu|ll of su|
|000003c0| 62 74 6c 65 74 79 2c 20 | 69 74 20 68 61 73 20 74 |btlety, |it has t|
|000003d0| 68 65 20 62 65 67 69 6e | 6e 69 6e 67 73 20 6f 66 |he begin|nings of|
|000003e0| 20 73 6f 6d 65 74 68 69 | 6e 67 20 74 68 61 74 20 | somethi|ng that |
|000003f0| 63 6f 75 6c 64 20 62 65 | 20 63 6f 6e 73 69 64 65 |could be| conside|
|00000400| 72 65 64 20 74 6f 20 62 | 65 20 70 65 72 73 6f 6e |red to b|e person|
|00000410| 61 6c 69 74 79 2e 20 20 | 4f 6e 65 20 73 75 62 74 |ality. |One subt|
|00000420| 6c 65 74 79 20 69 6e 76 | 6f 6c 76 65 73 20 74 68 |lety inv|olves th|
|00000430| 65 20 73 65 63 6f 6e 64 | 20 6d 6f 73 74 20 69 6d |e second| most im|
|00000440| 70 6f 72 74 61 6e 74 20 | 74 68 6f 75 67 68 74 20 |portant |thought |
|00000450| 74 68 61 74 d5 73 20 6f | 6e 20 74 68 65 20 6d 69 |that.s o|n the mi|
|00000460| 6e 64 73 20 6f 66 20 61 | 6e 79 20 63 6f 6d 70 75 |nds of a|ny compu|
|00000470| 74 65 72 20 70 72 6f 67 | 72 61 6d 6d 65 72 3a 20 |ter prog|rammer: |
|00000480| 20 65 78 65 63 75 74 69 | 6f 6e 20 73 70 65 65 64 | executi|on speed|
|00000490| 2e 20 20 57 68 79 20 69 | 73 20 5f 43 6f 70 79 42 |. Why i|s _CopyB|
|000004a0| 69 74 73 20 66 61 73 74 | 3f 20 20 57 68 79 20 69 |its fast|? Why i|
|000004b0| 73 20 69 74 20 73 6c 6f | 77 3f 20 20 43 61 6e 20 |s it slo|w? Can |
|000004c0| 49 20 69 6e 66 6c 75 65 | 6e 63 65 20 69 74 73 20 |I influe|nce its |
|000004d0| 73 70 65 65 64 3f 20 20 | 49 73 20 74 68 65 72 65 |speed? |Is there|
|000004e0| 20 72 65 61 6c 6c 79 20 | 61 20 63 6c 61 6e 64 65 | really |a clande|
|000004f0| 73 74 69 6e 65 20 73 74 | 61 74 65 20 6f 66 20 72 |stine st|ate of r|
|00000500| 65 61 73 6f 6e 3f 20 20 | 49 73 20 74 68 65 72 65 |eason? |Is there|
|00000510| 20 61 20 70 72 69 63 65 | 20 74 6f 20 73 70 65 65 | a price| to spee|
|00000520| 64 3f 0d 49 6e 66 6c 75 | 65 6e 63 65 73 20 6f 6e |d?.Influ|ences on|
|00000530| 20 74 68 65 20 53 70 65 | 65 64 20 6f 66 20 5f 43 | the Spe|ed of _C|
|00000540| 6f 70 79 42 69 74 73 0d | 59 65 73 2c 20 79 6f 75 |opyBits.|Yes, you|
|00000550| 20 63 61 6e 20 69 6e 66 | 6c 75 65 6e 63 65 20 74 | can inf|luence t|
|00000560| 68 65 20 73 70 65 65 64 | 20 6f 66 20 5f 43 6f 70 |he speed| of _Cop|
|00000570| 79 42 69 74 73 2e 20 20 | 59 65 73 2c 20 69 74 d5 |yBits. |Yes, it.|
|00000580| 73 20 65 76 65 6e 20 70 | 72 65 64 69 63 74 61 62 |s even p|redictab|
|00000590| 6c 65 2e 20 20 41 6e 64 | 20 79 65 73 2c 20 69 74 |le. And| yes, it|
|000005a0| d5 73 20 70 6f 73 73 69 | 62 6c 65 20 74 68 61 74 |.s possi|ble that|
|000005b0| 20 79 6f 75 20 68 61 76 | 65 20 74 6f 20 63 6f 6d | you hav|e to com|
|000005c0| 70 72 6f 6d 69 73 65 20 | 74 6f 20 67 65 74 20 74 |promise |to get t|
|000005d0| 68 65 20 6d 61 78 69 6d | 75 6d 20 73 70 65 65 64 |he maxim|um speed|
|000005e0| 2e 20 20 54 68 69 73 20 | 4e 6f 74 65 20 69 73 20 |. This |Note is |
|000005f0| 69 6e 74 65 6e 64 65 64 | 20 74 6f 20 67 69 76 65 |intended| to give|
|00000600| 20 79 6f 75 20 61 20 64 | 65 65 70 65 72 20 75 6e | you a d|eeper un|
|00000610| 64 65 72 73 74 61 6e 64 | 69 6e 67 20 6f 66 20 74 |derstand|ing of t|
|00000620| 68 65 20 77 61 79 73 20 | 74 68 61 74 20 74 68 65 |he ways |that the|
|00000630| 20 73 70 65 65 64 20 6f | 66 20 5f 43 6f 70 79 42 | speed o|f _CopyB|
|00000640| 69 74 73 20 63 61 6e 20 | 62 65 20 61 66 66 65 63 |its can |be affec|
|00000650| 74 65 64 3b 20 61 6e 64 | 20 68 6f 70 65 66 75 6c |ted; and| hopeful|
|00000660| 6c 79 20 79 6f 75 20 63 | 61 6e 20 74 68 65 6e 20 |ly you c|an then |
|00000670| 73 65 74 20 75 70 20 63 | 6f 6e 64 69 74 69 6f 6e |set up c|ondition|
|00000680| 73 20 66 6f 72 20 61 20 | 5f 43 6f 70 79 42 69 74 |s for a |_CopyBit|
|00000690| 73 20 63 61 6c 6c 20 77 | 69 74 68 6f 75 74 20 74 |s call w|ithout t|
|000006a0| 68 65 20 64 69 73 74 75 | 72 62 69 6e 67 20 6e 6f |he distu|rbing no|
|000006b0| 74 69 6f 6e 20 74 68 61 | 74 20 73 6f 6d 65 6f 6e |tion tha|t someon|
|000006c0| 65 20 65 6c 73 65 20 6d | 69 67 68 74 20 62 65 20 |e else m|ight be |
|000006d0| 64 6f 69 6e 67 20 74 68 | 65 20 73 61 6d 65 20 74 |doing th|e same t|
|000006e0| 68 69 6e 67 20 6a 75 73 | 74 20 61 20 6c 69 74 74 |hing jus|t a litt|
|000006f0| 6c 65 20 62 69 74 20 62 | 65 74 74 65 72 20 74 68 |le bit b|etter th|
|00000700| 61 6e 20 79 6f 75 2e 0d | 54 68 69 73 20 4e 6f 74 |an you..|This Not|
|00000710| 65 20 74 61 6c 6b 73 20 | 61 62 6f 75 74 20 65 76 |e talks |about ev|
|00000720| 65 72 79 20 66 61 63 74 | 6f 72 20 74 68 61 74 20 |ery fact|or that |
|00000730| 61 66 66 65 63 74 73 20 | 74 68 65 20 73 70 65 65 |affects |the spee|
|00000740| 64 20 6f 66 20 5f 43 6f | 70 79 42 69 74 73 20 74 |d of _Co|pyBits t|
|00000750| 68 61 74 20 49 20 63 61 | 6e 20 74 68 69 6e 6b 20 |hat I ca|n think |
|00000760| 6f 66 20 61 6e 64 20 74 | 68 61 74 20 63 61 6e 20 |of and t|hat can |
|00000770| 62 65 20 72 65 61 73 6f | 6e 61 62 6c 79 20 63 6f |be reaso|nably co|
|00000780| 6e 74 72 6f 6c 6c 65 64 | 20 62 79 20 61 20 70 72 |ntrolled| by a pr|
|00000790| 6f 67 72 61 6d 6d 65 72 | 20 6f 72 20 74 68 65 20 |ogrammer| or the |
|000007a0| 70 65 72 73 6f 6e 20 75 | 73 69 6e 67 20 61 6e 20 |person u|sing an |
|000007b0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 2e 20 20 54 68 |applicat|ion. Th|
|000007c0| 65 72 65 20 61 72 65 20 | 6f 74 68 65 72 20 66 61 |ere are |other fa|
|000007d0| 63 74 6f 72 73 20 6e 6f | 74 20 6d 65 6e 74 69 6f |ctors no|t mentio|
|000007e0| 6e 65 64 20 69 6e 20 74 | 68 69 73 20 4e 6f 74 65 |ned in t|his Note|
|000007f0| 20 62 65 63 61 75 73 65 | 20 49 20 66 65 6c 74 20 | because| I felt |
|00000800| 74 68 61 74 20 74 68 65 | 79 20 77 65 72 65 20 6a |that the|y were j|
|00000810| 75 73 74 20 74 6f 6f 20 | 65 73 6f 74 65 72 69 63 |ust too |esoteric|
|00000820| 20 74 6f 20 64 65 73 63 | 72 69 62 65 20 77 69 74 | to desc|ribe wit|
|00000830| 68 20 61 6e 79 20 6d 65 | 61 6e 69 6e 67 2e 0d 49 |h any me|aning..I|
|00000840| 6e 20 65 61 63 68 20 63 | 61 73 65 2c 20 74 68 69 |n each c|ase, thi|
|00000850| 73 20 4e 6f 74 65 20 74 | 72 69 65 73 20 74 6f 20 |s Note t|ries to |
|00000860| 67 69 76 65 20 72 65 61 | 6c 2d 6c 69 66 65 20 65 |give rea|l-life e|
|00000870| 78 61 6d 70 6c 65 73 20 | 73 68 6f 77 69 6e 67 20 |xamples |showing |
|00000880| 74 68 65 20 65 66 66 65 | 63 74 20 6f 66 20 65 61 |the effe|ct of ea|
|00000890| 63 68 20 66 61 63 74 6f | 72 2e 20 20 54 68 65 73 |ch facto|r. Thes|
|000008a0| 65 20 65 78 61 6d 70 6c | 65 73 20 61 72 65 20 6a |e exampl|es are j|
|000008b0| 75 73 74 20 74 6f 20 67 | 69 76 65 20 79 6f 75 20 |ust to g|ive you |
|000008c0| 61 20 72 65 6c 61 74 69 | 76 65 20 69 64 65 61 20 |a relati|ve idea |
|000008d0| 6f 66 20 74 68 65 20 69 | 6d 70 6f 72 74 61 6e 63 |of the i|mportanc|
|000008e0| 65 20 6f 66 20 65 61 63 | 68 20 65 66 66 65 63 74 |e of eac|h effect|
|000008f0| 2e 20 20 49 6e 20 72 65 | 61 6c 20 6c 69 66 65 2c |. In re|al life,|
|00000900| 20 74 68 65 20 65 66 66 | 65 63 74 73 20 6f 66 20 | the eff|ects of |
|00000910| 74 68 65 20 64 69 66 66 | 65 72 65 6e 74 20 66 61 |the diff|erent fa|
|00000920| 63 74 6f 72 73 20 67 69 | 76 65 20 72 65 73 75 6c |ctors gi|ve resul|
|00000930| 74 73 20 74 68 61 74 20 | 63 6f 75 6c 64 20 62 65 |ts that |could be|
|00000940| 20 61 20 6c 6f 74 20 64 | 69 66 66 65 72 65 6e 74 | a lot d|ifferent|
|00000950| 20 66 72 6f 6d 20 74 68 | 65 20 72 65 73 75 6c 74 | from th|e result|
|00000960| 73 20 70 72 65 73 65 6e | 74 65 64 20 69 6e 20 74 |s presen|ted in t|
|00000970| 68 69 73 20 4e 6f 74 65 | 2e 20 20 45 61 63 68 20 |his Note|. Each |
|00000980| 65 78 61 6d 70 6c 65 20 | 69 73 20 62 61 73 65 64 |example |is based|
|00000990| 20 6f 6e 20 31 30 30 20 | 5f 43 6f 70 79 42 69 74 | on 100 |_CopyBit|
|000009a0| 73 20 63 61 6c 6c 73 20 | 66 72 6f 6d 20 61 6e 20 |s calls |from an |
|000009b0| 6f 66 66 2d 73 63 72 65 | 65 6e 20 70 69 78 65 6c |off-scre|en pixel|
|000009c0| 20 6d 61 70 20 74 6f 20 | 74 68 65 20 73 63 72 65 | map to |the scre|
|000009d0| 65 6e 20 6f 6e 20 61 20 | 4d 61 63 69 6e 74 6f 73 |en on a |Macintos|
|000009e0| 68 20 49 49 63 78 20 77 | 69 74 68 20 61 6e 20 41 |h IIcx w|ith an A|
|000009f0| 70 70 6c 65 20 45 78 74 | 65 6e 64 65 64 20 56 69 |pple Ext|ended Vi|
|00000a00| 64 65 6f 20 43 61 72 64 | 20 77 68 69 63 68 20 69 |deo Card| which i|
|00000a10| 73 20 72 75 6e 6e 69 6e | 67 20 53 79 73 74 65 6d |s runnin|g System|
|00000a20| 20 53 6f 66 74 77 61 72 | 65 20 36 2e 30 2e 35 20 | Softwar|e 6.0.5 |
|00000a30| 61 6e 64 20 33 32 2d 42 | 69 74 20 51 75 69 63 6b |and 32-B|it Quick|
|00000a40| 44 72 61 77 20 31 2e 32 | 2e 20 20 54 68 65 20 6f |Draw 1.2|. The o|
|00000a50| 66 66 2d 73 63 72 65 65 | 6e 20 70 69 78 65 6c 20 |ff-scree|n pixel |
|00000a60| 6d 61 70 20 69 73 20 65 | 69 67 68 74 20 62 69 74 |map is e|ight bit|
|00000a70| 73 20 64 65 65 70 20 77 | 69 74 68 20 74 68 65 20 |s deep w|ith the |
|00000a80| 73 74 61 6e 64 61 72 64 | 20 65 69 67 68 74 2d 62 |standard| eight-b|
|00000a90| 69 74 20 63 6f 6c 6f 72 | 20 74 61 62 6c 65 20 61 |it color| table a|
|00000aa0| 6e 64 20 32 35 36 20 70 | 69 78 65 6c 73 20 68 69 |nd 256 p|ixels hi|
|00000ab0| 67 68 20 62 79 20 32 35 | 36 20 70 69 78 65 6c 73 |gh by 25|6 pixels|
|00000ac0| 20 77 69 64 65 2e 20 20 | 54 68 65 20 73 63 72 65 | wide. |The scre|
|00000ad0| 65 6e 20 69 73 20 61 6c | 73 6f 20 69 6e 20 65 69 |en is al|so in ei|
|00000ae0| 67 68 74 2d 62 69 74 20 | 63 6f 6c 6f 72 20 6d 6f |ght-bit |color mo|
|00000af0| 64 65 2e 20 20 43 61 6c | 6c 69 6e 67 20 5f 43 6f |de. Cal|ling _Co|
|00000b00| 70 79 42 69 74 73 20 74 | 6f 20 63 6f 70 79 20 74 |pyBits t|o copy t|
|00000b10| 68 65 20 65 6e 74 69 72 | 65 20 6f 66 66 2d 73 63 |he entir|e off-sc|
|00000b20| 72 65 65 6e 20 70 69 78 | 65 6c 20 6d 61 70 20 74 |reen pix|el map t|
|00000b30| 6f 20 74 68 65 20 73 63 | 72 65 65 6e 20 31 30 30 |o the sc|reen 100|
|00000b40| 20 74 69 6d 65 73 20 74 | 61 6b 65 73 20 32 30 34 | times t|akes 204|
|00000b50| 20 74 69 63 6b 73 2c 20 | 61 6e 64 20 74 68 69 73 | ticks, |and this|
|00000b60| 20 4e 6f 74 65 20 72 65 | 66 65 72 73 20 74 6f 20 | Note re|fers to |
|00000b70| 74 68 69 73 20 66 69 67 | 75 72 65 20 61 73 20 74 |this fig|ure as t|
|00000b80| 68 65 20 d2 73 74 61 6e | 64 61 72 64 20 74 65 73 |he .stan|dard tes|
|00000b90| 74 2e d3 20 20 53 69 6e | 63 65 20 61 20 74 69 63 |t.. Sin|ce a tic|
|00000ba0| 6b 20 6f 6e 20 61 20 4d | 61 63 69 6e 74 6f 73 68 |k on a M|acintosh|
|00000bb0| 20 69 73 20 61 70 70 72 | 6f 78 69 6d 61 74 65 6c | is appr|oximatel|
|00000bc0| 79 20 31 2f 36 30 20 6f | 66 20 61 20 73 65 63 6f |y 1/60 o|f a seco|
|00000bd0| 6e 64 2c 20 74 68 65 20 | 73 74 61 6e 64 61 72 64 |nd, the |standard|
|00000be0| 20 74 65 73 74 20 72 75 | 6e 73 20 61 74 20 73 6c | test ru|ns at sl|
|00000bf0| 69 67 68 74 6c 79 20 6c | 65 73 73 20 74 68 61 6e |ightly l|ess than|
|00000c00| 20 33 30 20 66 72 61 6d | 65 73 20 70 65 72 20 73 | 30 fram|es per s|
|00000c10| 65 63 6f 6e 64 2e 20 20 | 41 73 20 74 68 69 73 20 |econd. |As this |
|00000c20| 4e 6f 74 65 20 64 69 73 | 63 75 73 73 65 73 20 65 |Note dis|cusses e|
|00000c30| 61 63 68 20 66 61 63 74 | 6f 72 2c 20 69 74 20 70 |ach fact|or, it p|
|00000c40| 72 65 73 65 6e 74 73 20 | 61 6e 20 65 78 61 6d 70 |resents |an examp|
|00000c50| 6c 65 20 77 69 74 68 20 | 74 68 61 74 20 66 61 63 |le with |that fac|
|00000c60| 74 6f 72 20 63 68 61 6e | 67 69 6e 67 20 61 6e 64 |tor chan|ging and|
|00000c70| 20 61 6c 6c 20 6f 74 68 | 65 72 20 66 61 63 74 6f | all oth|er facto|
|00000c80| 72 73 20 72 65 6d 61 69 | 6e 69 6e 67 20 74 68 65 |rs remai|ning the|
|00000c90| 20 73 61 6d 65 20 61 73 | 20 74 68 65 20 73 74 61 | same as| the sta|
|00000ca0| 6e 64 61 72 64 20 74 65 | 73 74 2c 20 77 68 69 63 |ndard te|st, whic|
|00000cb0| 68 20 61 6c 6c 6f 77 73 | 20 79 6f 75 20 74 6f 20 |h allows| you to |
|00000cc0| 63 6f 6d 70 61 72 65 20 | 70 65 72 66 6f 72 6d 61 |compare |performa|
|00000cd0| 6e 63 65 20 6f 66 20 74 | 68 65 20 63 68 61 6e 67 |nce of t|he chang|
|00000ce0| 65 64 20 66 61 63 74 6f | 72 20 74 6f 20 74 68 61 |ed facto|r to tha|
|00000cf0| 74 20 6f 66 20 74 68 65 | 20 73 74 61 6e 64 61 72 |t of the| standar|
|00000d00| 64 20 74 65 73 74 20 6f | 66 20 32 30 34 20 74 69 |d test o|f 204 ti|
|00000d10| 63 6b 73 2e 0d 57 68 61 | 74 20 66 6f 6c 6c 6f 77 |cks..Wha|t follow|
|00000d20| 73 20 69 73 20 61 20 64 | 69 73 63 75 73 73 69 6f |s is a d|iscussio|
|00000d30| 6e 20 6f 66 20 65 61 63 | 68 20 66 61 63 74 6f 72 |n of eac|h factor|
|00000d40| 20 74 68 61 74 20 63 61 | 6e 20 69 6e 66 6c 75 65 | that ca|n influe|
|00000d50| 6e 63 65 20 74 68 65 20 | 73 70 65 65 64 20 6f 66 |nce the |speed of|
|00000d60| 20 5f 43 6f 70 79 42 69 | 74 73 2c 20 69 6e 20 6e | _CopyBi|ts, in n|
|00000d70| 6f 20 70 61 72 74 69 63 | 75 6c 61 72 20 6f 72 64 |o partic|ular ord|
|00000d80| 65 72 2e 0d 44 69 6d 65 | 6e 73 69 6f 6e 73 20 6f |er..Dime|nsions o|
|00000d90| 66 20 74 68 65 20 43 6f | 70 69 65 64 20 41 72 65 |f the Co|pied Are|
|00000da0| 61 0d 4f 6e 65 20 6f 66 | 20 20 74 68 65 20 6d 6f |a.One of| the mo|
|00000db0| 73 74 20 6f 62 76 69 6f | 75 73 20 66 61 63 74 6f |st obvio|us facto|
|00000dc0| 72 73 20 68 61 73 20 74 | 6f 20 64 6f 20 77 69 74 |rs has t|o do wit|
|00000dd0| 68 20 74 68 65 20 64 69 | 6d 65 6e 73 69 6f 6e 73 |h the di|mensions|
|00000de0| 20 6f 66 20 74 68 65 20 | 63 6f 70 69 65 64 20 61 | of the |copied a|
|00000df0| 72 65 61 2e 20 20 5f 43 | 6f 70 79 42 69 74 73 20 |rea. _C|opyBits |
|00000e00| 74 61 6b 65 73 20 61 73 | 20 70 61 72 61 6d 65 74 |takes as| paramet|
|00000e10| 65 72 73 20 74 77 6f 20 | 72 65 63 74 61 6e 67 6c |ers two |rectangl|
|00000e20| 65 73 20 77 68 69 63 68 | 20 73 70 65 63 69 66 79 |es which| specify|
|00000e30| 20 74 68 65 20 70 6f 72 | 74 69 6f 6e 20 6f 66 20 | the por|tion of |
|00000e40| 74 68 65 20 73 6f 75 72 | 63 65 20 70 69 78 65 6c |the sour|ce pixel|
|00000e50| 20 6d 61 70 20 66 72 6f | 6d 20 77 68 69 63 68 20 | map fro|m which |
|00000e60| 79 6f 75 20 77 61 6e 74 | 20 74 6f 20 63 6f 70 79 |you want| to copy|
|00000e70| 20 61 6e 64 20 74 68 65 | 20 70 6f 72 74 69 6f 6e | and the| portion|
|00000e80| 20 6f 66 20 74 68 65 20 | 64 65 73 74 69 6e 61 74 | of the |destinat|
|00000e90| 69 6f 6e 20 70 69 78 65 | 6c 20 6d 61 70 20 74 6f |ion pixe|l map to|
|00000ea0| 20 77 68 69 63 68 20 79 | 6f 75 20 77 61 6e 74 20 | which y|ou want |
|00000eb0| 74 6f 20 63 6f 70 79 20 | 69 74 2e 20 20 41 6c 6c |to copy |it. All|
|00000ec0| 20 6f 74 68 65 72 20 66 | 61 63 74 6f 72 73 20 62 | other f|actors b|
|00000ed0| 65 69 6e 67 20 65 71 75 | 61 6c 2c 20 74 68 65 20 |eing equ|al, the |
|00000ee0| 6c 61 72 67 65 72 20 74 | 68 65 20 72 65 63 74 61 |larger t|he recta|
|00000ef0| 6e 67 6c 65 73 2c 20 74 | 68 65 20 6d 6f 72 65 20 |ngles, t|he more |
|00000f00| 70 69 78 65 6c 73 20 5f | 43 6f 70 79 42 69 74 73 |pixels _|CopyBits|
|00000f10| 20 68 61 73 20 74 6f 20 | 63 6f 70 79 20 61 6e 64 | has to |copy and|
|00000f20| 20 74 68 65 20 6c 6f 6e | 67 65 72 20 69 74 20 74 | the lon|ger it t|
|00000f30| 61 6b 65 73 20 74 6f 20 | 64 6f 20 74 68 65 20 6a |akes to |do the j|
|00000f40| 6f 62 2e 20 20 54 6f 20 | 6b 65 65 70 20 5f 43 6f |ob. To |keep _Co|
|00000f50| 70 79 42 69 74 73 20 61 | 73 20 66 61 73 74 20 61 |pyBits a|s fast a|
|00000f60| 73 20 70 6f 73 73 69 62 | 6c 65 2c 20 63 6f 70 79 |s possib|le, copy|
|00000f70| 20 74 68 65 20 73 6d 61 | 6c 6c 65 73 74 20 72 65 | the sma|llest re|
|00000f80| 63 74 61 6e 67 6c 65 20 | 70 6f 73 73 69 62 6c 65 |ctangle |possible|
|00000f90| 2e 0d 4d 6f 64 69 66 79 | 69 6e 67 20 74 68 65 20 |..Modify|ing the |
|00000fa0| 73 74 61 6e 64 61 72 64 | 20 74 65 73 74 20 73 6f |standard| test so|
|00000fb0| 20 74 68 61 74 20 5f 43 | 6f 70 79 42 69 74 73 20 | that _C|opyBits |
|00000fc0| 6f 6e 6c 79 20 63 6f 70 | 69 65 73 20 61 20 31 32 |only cop|ies a 12|
|00000fd0| 38 2d 70 69 78 65 6c 20 | 77 69 64 65 20 62 79 20 |8-pixel |wide by |
|00000fe0| 31 32 38 2d 70 69 78 65 | 6c 20 74 61 6c 6c 20 61 |128-pixe|l tall a|
|00000ff0| 72 65 61 20 70 72 6f 64 | 75 63 65 73 20 61 20 72 |rea prod|uces a r|
|00001000| 65 73 75 6c 74 20 6f 66 | 20 31 30 39 20 74 69 63 |esult of| 109 tic|
|00001010| 6b 73 2c 20 77 68 69 63 | 68 20 63 6f 6d 70 61 72 |ks, whic|h compar|
|00001020| 65 73 20 74 6f 20 74 68 | 65 20 32 30 34 20 74 69 |es to th|e 204 ti|
|00001030| 63 6b 20 70 65 72 66 6f | 72 6d 61 6e 63 65 20 66 |ck perfo|rmance f|
|00001040| 6f 72 20 61 20 32 35 36 | 2d 70 69 78 65 6c 20 77 |or a 256|-pixel w|
|00001050| 69 64 65 20 62 79 20 32 | 35 36 2d 70 69 78 65 6c |ide by 2|56-pixel|
|00001060| 20 74 61 6c 6c 20 61 72 | 65 61 2e 0d 51 75 69 63 | tall ar|ea..Quic|
|00001070| 6b 44 72 61 77 20 69 73 | 20 75 73 75 61 6c 6c 79 |kDraw is| usually|
|00001080| 20 66 61 73 74 65 72 20 | 64 72 61 77 69 6e 67 20 | faster |drawing |
|00001090| 77 69 64 65 20 74 68 69 | 6e 67 73 20 74 68 61 6e |wide thi|ngs than|
|000010a0| 20 69 74 20 69 73 20 64 | 72 61 77 69 6e 67 20 74 | it is d|rawing t|
|000010b0| 61 6c 6c 20 74 68 69 6e | 67 73 2c 20 62 65 63 61 |all thin|gs, beca|
|000010c0| 75 73 65 20 63 6f 6e 73 | 65 63 75 74 69 76 65 20 |use cons|ecutive |
|000010d0| 70 69 78 65 6c 73 20 69 | 6e 20 6d 65 6d 6f 72 79 |pixels i|n memory|
|000010e0| 20 61 72 65 20 64 69 73 | 70 6c 61 79 65 64 20 68 | are dis|played h|
|000010f0| 6f 72 69 7a 6f 6e 74 61 | 6c 6c 79 2e 20 20 44 72 |orizonta|lly. Dr|
|00001100| 61 77 69 6e 67 20 61 20 | 73 65 72 69 65 73 20 6f |awing a |series o|
|00001110| 66 20 70 69 78 65 6c 73 | 20 74 68 61 74 20 61 72 |f pixels| that ar|
|00001120| 65 20 6e 65 78 74 20 74 | 6f 20 65 61 63 68 20 6f |e next t|o each o|
|00001130| 74 68 65 72 20 68 6f 72 | 69 7a 6f 6e 74 61 6c 6c |ther hor|izontall|
|00001140| 79 20 69 73 20 65 61 73 | 79 20 62 65 63 61 75 73 |y is eas|y becaus|
|00001150| 65 20 51 75 69 63 6b 44 | 72 61 77 20 73 69 6d 70 |e QuickD|raw simp|
|00001160| 6c 79 20 68 61 73 20 74 | 6f 20 73 65 74 20 63 6f |ly has t|o set co|
|00001170| 6e 73 65 63 75 74 69 76 | 65 20 6d 65 6d 6f 72 79 |nsecutiv|e memory|
|00001180| 20 6c 6f 63 61 74 69 6f | 6e 73 2c 20 77 68 69 6c | locatio|ns, whil|
|00001190| 65 20 64 72 61 77 69 6e | 67 20 61 20 73 65 72 69 |e drawin|g a seri|
|000011a0| 65 73 20 6f 66 20 70 69 | 78 65 6c 73 20 74 68 61 |es of pi|xels tha|
|000011b0| 74 20 61 72 65 20 6e 65 | 78 74 20 74 6f 20 65 61 |t are ne|xt to ea|
|000011c0| 63 68 20 6f 74 68 65 72 | 20 76 65 72 74 69 63 61 |ch other| vertica|
|000011d0| 6c 6c 79 20 69 73 20 6a | 75 73 74 20 61 20 6c 69 |lly is j|ust a li|
|000011e0| 74 74 6c 65 20 62 69 74 | 20 68 61 72 64 65 72 20 |ttle bit| harder |
|000011f0| 62 65 63 61 75 73 65 20 | 74 68 65 20 61 64 64 72 |because |the addr|
|00001200| 65 73 73 20 6f 66 20 65 | 61 63 68 20 70 69 78 65 |ess of e|ach pixe|
|00001210| 6c 20 6d 75 73 74 20 62 | 65 20 63 61 6c 63 75 6c |l must b|e calcul|
|00001220| 61 74 65 64 2e 20 20 5f | 43 6f 70 79 42 69 74 73 |ated. _|CopyBits|
|00001230| 20 69 73 20 6e 6f 20 65 | 78 63 65 70 74 69 6f 6e | is no e|xception|
|00001240| 20 74 6f 20 74 68 69 73 | 20 67 65 6e 65 72 61 6c | to this| general|
|00001250| 20 72 75 6c 65 3b 20 69 | 74 20 63 6f 70 69 65 73 | rule; i|t copies|
|00001260| 20 61 20 72 6f 77 20 6f | 66 20 70 69 78 65 6c 73 | a row o|f pixels|
|00001270| 2c 20 67 6f 65 73 20 74 | 6f 20 74 68 65 20 6e 65 |, goes t|o the ne|
|00001280| 78 74 20 72 6f 77 2c 20 | 63 6f 70 69 65 73 20 74 |xt row, |copies t|
|00001290| 68 61 74 20 72 6f 77 2c | 20 67 6f 65 73 20 74 6f |hat row,| goes to|
|000012a0| 20 74 68 65 20 6e 65 78 | 74 20 72 6f 77 2c 20 61 | the nex|t row, a|
|000012b0| 6e 64 20 73 6f 20 6f 6e | 2e 20 20 54 68 65 20 74 |nd so on|. The t|
|000012c0| 69 6d 65 20 73 70 65 6e | 74 20 67 6f 69 6e 67 20 |ime spen|t going |
|000012d0| 62 65 74 77 65 65 6e 20 | 72 6f 77 73 20 69 73 20 |between |rows is |
|000012e0| 61 20 6c 6f 74 20 6d 6f | 72 65 20 74 68 61 6e 20 |a lot mo|re than |
|000012f0| 74 68 65 20 74 69 6d 65 | 20 67 6f 69 6e 67 20 62 |the time| going b|
|00001300| 65 74 77 65 65 6e 20 70 | 69 78 65 6c 73 20 6f 6e |etween p|ixels on|
|00001310| 20 6f 6e 65 20 72 6f 77 | 2c 20 73 6f 20 74 68 65 | one row|, so the|
|00001320| 20 65 66 66 65 63 74 20 | 69 73 20 74 68 61 74 20 | effect |is that |
|00001330| 5f 43 6f 70 79 42 69 74 | 73 20 69 73 20 66 61 73 |_CopyBit|s is fas|
|00001340| 74 65 72 20 63 6f 70 79 | 69 6e 67 20 61 20 73 68 |ter copy|ing a sh|
|00001350| 6f 72 74 20 61 6e 64 20 | 77 69 64 65 20 73 65 63 |ort and |wide sec|
|00001360| 74 69 6f 6e 20 6f 66 20 | 61 20 70 69 78 65 6c 20 |tion of |a pixel |
|00001370| 6d 61 70 20 74 68 61 6e | 20 69 74 20 69 73 20 63 |map than| it is c|
|00001380| 6f 70 79 69 6e 67 20 61 | 20 74 61 6c 6c 20 61 6e |opying a| tall an|
|00001390| 64 20 6e 61 72 72 6f 77 | 20 6f 6e 65 2e 20 20 54 |d narrow| one. T|
|000013a0| 6f 20 6b 65 65 70 20 5f | 43 6f 70 79 42 69 74 73 |o keep _|CopyBits|
|000013b0| 20 61 73 20 66 61 73 74 | 20 61 73 20 70 6f 73 73 | as fast| as poss|
|000013c0| 69 62 6c 65 2c 20 63 6f | 70 79 20 74 68 65 20 73 |ible, co|py the s|
|000013d0| 68 6f 72 74 65 73 74 20 | 72 65 63 74 61 6e 67 6c |hortest |rectangl|
|000013e0| 65 20 70 6f 73 73 69 62 | 6c 65 2e 0d 4d 6f 64 69 |e possib|le..Modi|
|000013f0| 66 79 69 6e 67 20 74 68 | 65 20 73 74 61 6e 64 61 |fying th|e standa|
|00001400| 72 64 20 74 65 73 74 20 | 61 67 61 69 6e 20 73 6f |rd test |again so|
|00001410| 20 74 68 61 74 20 74 68 | 65 20 73 6f 75 72 63 65 | that th|e source|
|00001420| 20 61 6e 64 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | and des|tination|
|00001430| 20 72 65 63 74 61 6e 67 | 6c 65 73 20 61 72 65 20 | rectang|les are |
|00001440| 32 35 36 20 70 69 78 65 | 6c 73 20 77 69 64 65 20 |256 pixe|ls wide |
|00001450| 62 79 20 35 30 20 70 69 | 78 65 6c 73 20 74 61 6c |by 50 pi|xels tal|
|00001460| 6c 20 70 72 6f 64 75 63 | 65 73 20 61 20 72 65 73 |l produc|es a res|
|00001470| 75 6c 74 20 6f 66 20 31 | 31 30 20 74 69 63 6b 73 |ult of 1|10 ticks|
|00001480| 2c 20 77 68 69 6c 65 20 | 6d 6f 64 69 66 79 69 6e |, while |modifyin|
|00001490| 67 20 69 74 20 73 6f 20 | 74 68 61 74 20 74 68 65 |g it so |that the|
|000014a0| 20 73 6f 75 72 63 65 20 | 61 6e 64 20 64 65 73 74 | source |and dest|
|000014b0| 69 6e 61 74 69 6f 6e 20 | 72 65 63 74 61 6e 67 6c |ination |rectangl|
|000014c0| 65 73 20 61 72 65 20 35 | 30 20 70 69 78 65 6c 73 |es are 5|0 pixels|
|000014d0| 20 77 69 64 65 20 62 79 | 20 32 35 36 20 70 69 78 | wide by| 256 pix|
|000014e0| 65 6c 73 20 74 61 6c 6c | 20 72 65 73 75 6c 74 73 |els tall| results|
|000014f0| 20 69 6e 20 61 20 74 69 | 6d 65 20 6f 66 20 31 32 | in a ti|me of 12|
|00001500| 33 20 74 69 63 6b 73 2e | 20 20 54 68 65 73 65 20 |3 ticks.| These |
|00001510| 31 33 20 74 69 63 6b 73 | 20 6d 61 79 20 6e 6f 74 |13 ticks| may not|
|00001520| 20 73 65 65 6d 20 6c 69 | 6b 65 20 61 20 62 69 67 | seem li|ke a big|
|00001530| 20 64 65 61 6c 2c 20 62 | 75 74 20 63 6f 6d 62 69 | deal, b|ut combi|
|00001540| 6e 65 64 20 77 69 74 68 | 20 6f 74 68 65 72 20 66 |ned with| other f|
|00001550| 61 63 74 6f 72 73 2c 20 | 74 68 65 72 65 20 6d 61 |actors, |there ma|
|00001560| 79 20 62 65 20 61 20 63 | 61 73 65 20 77 68 65 72 |y be a c|ase wher|
|00001570| 65 20 74 68 65 79 20 6d | 61 6b 65 20 61 20 62 69 |e they m|ake a bi|
|00001580| 67 20 64 69 66 66 65 72 | 65 6e 63 65 2e 0d 53 68 |g differ|ence..Sh|
|00001590| 61 70 65 20 61 6e 64 20 | 53 69 7a 65 20 6f 66 20 |ape and |Size of |
|000015a0| 74 68 65 20 43 6c 69 70 | 2c 20 56 69 73 69 62 6c |the Clip|, Visibl|
|000015b0| 65 2c 20 61 6e 64 20 4d | 61 73 6b 20 52 65 67 69 |e, and M|ask Regi|
|000015c0| 6f 6e 73 0d 5f 43 6f 70 | 79 42 69 74 73 20 61 6c |ons._Cop|yBits al|
|000015d0| 77 61 79 73 20 6d 61 6b | 65 73 20 73 75 72 65 20 |ways mak|es sure |
|000015e0| 74 68 61 74 20 69 74 20 | 73 74 61 79 73 20 77 69 |that it |stays wi|
|000015f0| 74 68 69 6e 20 74 68 65 | 20 6c 69 6e 65 73 2c 20 |thin the| lines, |
|00001600| 73 6f 20 74 6f 20 73 70 | 65 61 6b 2e 20 20 5f 43 |so to sp|eak. _C|
|00001610| 6f 70 79 42 69 74 73 20 | 63 6f 70 69 65 73 20 70 |opyBits |copies p|
|00001620| 69 78 65 6c 73 20 63 6c | 69 70 70 65 64 20 74 6f |ixels cl|ipped to|
|00001630| 20 74 68 65 20 6d 61 73 | 6b 52 67 6e 20 74 68 61 | the mas|kRgn tha|
|00001640| 74 20 79 6f 75 20 70 61 | 73 73 20 61 73 20 74 68 |t you pa|ss as th|
|00001650| 65 20 6c 61 73 74 20 70 | 61 72 61 6d 65 74 65 72 |e last p|arameter|
|00001660| 20 74 6f 20 74 68 65 20 | 63 61 6c 6c 2e 20 20 49 | to the |call. I|
|00001670| 66 20 74 68 65 20 64 65 | 73 74 69 6e 61 74 69 6f |f the de|stinatio|
|00001680| 6e 20 69 73 20 74 68 65 | 20 63 75 72 72 65 6e 74 |n is the| current|
|00001690| 20 47 72 61 66 50 6f 72 | 74 2c 20 5f 43 6f 70 79 | GrafPor|t, _Copy|
|000016a0| 42 69 74 73 20 61 64 64 | 69 74 69 6f 6e 61 6c 6c |Bits add|itionall|
|000016b0| 79 20 63 6c 69 70 73 20 | 74 6f 20 61 20 72 65 67 |y clips |to a reg|
|000016c0| 69 6f 6e 20 74 68 61 74 | d5 73 20 74 68 65 20 69 |ion that|.s the i|
|000016d0| 6e 74 65 72 73 65 63 74 | 69 6f 6e 20 6f 66 20 74 |ntersect|ion of t|
|000016e0| 68 65 20 63 6c 69 70 52 | 67 6e 20 61 6e 64 20 76 |he clipR|gn and v|
|000016f0| 69 73 52 67 6e 20 6f 66 | 20 74 68 65 20 70 6f 72 |isRgn of| the por|
|00001700| 74 2e 20 20 49 66 20 74 | 68 65 20 69 6e 74 65 72 |t. If t|he inter|
|00001710| 73 65 63 74 69 6f 6e 20 | 6f 66 20 74 68 65 73 65 |section |of these|
|00001720| 20 74 68 72 65 65 20 72 | 65 67 69 6f 6e 73 20 69 | three r|egions i|
|00001730| 73 20 6e 6f 74 20 72 65 | 63 74 61 6e 67 75 6c 61 |s not re|ctangula|
|00001740| 72 2c 20 74 68 65 6e 20 | 5f 43 6f 70 79 42 69 74 |r, then |_CopyBit|
|00001750| 73 20 68 61 73 20 74 6f | 20 63 68 65 63 6b 20 65 |s has to| check e|
|00001760| 61 63 68 20 70 69 78 65 | 6c 20 74 6f 20 6d 61 6b |ach pixe|l to mak|
|00001770| 65 20 73 75 72 65 20 69 | 74 20 66 61 6c 6c 73 20 |e sure i|t falls |
|00001780| 77 69 74 68 69 6e 20 74 | 68 65 20 69 6e 74 65 72 |within t|he inter|
|00001790| 73 65 63 74 69 6f 6e 2c | 20 61 6e 64 20 74 68 69 |section,| and thi|
|000017a0| 73 20 63 68 65 63 6b 20 | 73 6c 6f 77 73 20 5f 43 |s check |slows _C|
|000017b0| 6f 70 79 42 69 74 73 20 | 64 6f 77 6e 2e 20 20 49 |opyBits |down. I|
|000017c0| 66 20 74 68 65 20 69 6e | 74 65 72 73 65 63 74 69 |f the in|tersecti|
|000017d0| 6f 6e 20 6f 66 20 74 68 | 65 73 65 20 74 68 72 65 |on of th|ese thre|
|000017e0| 65 20 72 65 67 69 6f 6e | 73 20 69 73 20 72 65 63 |e region|s is rec|
|000017f0| 74 61 6e 67 75 6c 61 72 | 2c 20 74 68 65 6e 20 5f |tangular|, then _|
|00001800| 43 6f 70 79 42 69 74 73 | 20 74 61 6b 65 73 20 74 |CopyBits| takes t|
|00001810| 68 65 20 66 61 73 74 20 | 63 61 73 65 20 6f 66 20 |he fast |case of |
|00001820| 63 6f 70 79 69 6e 67 20 | 63 6f 6e 73 74 61 6e 74 |copying |constant|
|00001830| 2d 73 69 7a 65 64 20 72 | 6f 77 73 2e 20 20 54 6f |-sized r|ows. To|
|00001840| 20 6b 65 65 70 20 5f 43 | 6f 70 79 42 69 74 73 20 | keep _C|opyBits |
|00001850| 61 73 20 66 61 73 74 20 | 61 73 20 70 6f 73 73 69 |as fast |as possi|
|00001860| 62 6c 65 2c 20 6d 61 6b | 65 20 73 75 72 65 20 74 |ble, mak|e sure t|
|00001870| 68 65 20 69 6e 74 65 72 | 73 65 63 74 69 6f 6e 20 |he inter|section |
|00001880| 6f 66 20 74 68 65 20 63 | 6c 69 70 52 67 6e 20 61 |of the c|lipRgn a|
|00001890| 6e 64 20 76 69 73 52 67 | 6e 20 6f 66 20 74 68 65 |nd visRg|n of the|
|000018a0| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 47 72 61 | destina|tion Gra|
|000018b0| 66 50 6f 72 74 20 61 6e | 64 20 74 68 65 20 6d 61 |fPort an|d the ma|
|000018c0| 73 6b 52 67 6e 20 69 73 | 20 72 65 63 74 61 6e 67 |skRgn is| rectang|
|000018d0| 75 6c 61 72 2e 20 20 4f | 66 20 63 6f 75 72 73 65 |ular. O|f course|
|000018e0| 2c 20 69 66 20 74 68 65 | 20 64 65 73 74 69 6e 61 |, if the| destina|
|000018f0| 74 69 6f 6e 20 47 72 61 | 66 50 6f 72 74 20 69 73 |tion Gra|fPort is|
|00001900| 20 61 20 77 69 6e 64 6f | 77 2c 20 74 68 65 6e 20 | a windo|w, then |
|00001910| 74 68 65 20 76 69 73 52 | 67 6e 20 69 73 20 75 6e |the visR|gn is un|
|00001920| 64 65 72 20 74 68 65 20 | 75 73 65 72 d5 73 20 63 |der the |user.s c|
|00001930| 6f 6e 74 72 6f 6c 2e 0d | 49 6e 20 67 65 6e 65 72 |ontrol..|In gener|
|00001940| 61 6c 2c 20 69 66 20 74 | 68 65 20 72 65 67 69 6f |al, if t|he regio|
|00001950| 6e 20 74 68 61 74 20 79 | 6f 75 20 61 72 65 20 63 |n that y|ou are c|
|00001960| 6f 70 79 69 6e 67 20 69 | 6e 74 6f 20 68 61 73 20 |opying i|nto has |
|00001970| 73 74 72 61 69 67 68 74 | 20 76 65 72 74 69 63 61 |straight| vertica|
|00001980| 6c 20 65 64 67 65 73 20 | 66 6f 72 20 74 68 65 20 |l edges |for the |
|00001990| 6d 6f 73 74 20 70 61 72 | 74 2c 20 74 68 65 20 74 |most par|t, the t|
|000019a0| 69 6d 65 20 70 65 6e 61 | 6c 74 79 20 6f 66 20 75 |ime pena|lty of u|
|000019b0| 73 69 6e 67 20 61 20 6e | 6f 6e 2d 72 65 63 74 61 |sing a n|on-recta|
|000019c0| 6e 67 75 6c 61 72 20 72 | 65 67 69 6f 6e 20 69 73 |ngular r|egion is|
|000019d0| 20 6e 6f 74 20 74 68 61 | 74 20 62 61 64 2e 20 20 | not tha|t bad. |
|000019e0| 52 65 67 69 6f 6e 73 20 | 74 68 61 74 20 6f 6e 6c |Regions |that onl|
|000019f0| 79 20 68 61 76 65 20 73 | 6d 61 6c 6c 20 70 6f 72 |y have s|mall por|
|00001a00| 74 69 6f 6e 73 20 74 68 | 61 74 20 61 72 65 20 73 |tions th|at are s|
|00001a10| 74 72 61 69 67 68 74 20 | 61 6e 64 20 76 65 72 74 |traight |and vert|
|00001a20| 69 63 61 6c 20 61 72 65 | 20 74 68 65 20 6f 6e 65 |ical are| the one|
|00001a30| 73 20 74 68 61 74 20 73 | 6c 6f 77 20 5f 43 6f 70 |s that s|low _Cop|
|00001a40| 79 42 69 74 73 20 64 6f | 77 6e 20 69 6e 20 61 20 |yBits do|wn in a |
|00001a50| 62 69 67 20 77 61 79 2e | 20 20 52 65 67 69 6f 6e |big way.| Region|
|00001a60| 73 20 74 68 61 74 20 61 | 72 65 20 74 77 69 73 74 |s that a|re twist|
|00001a70| 65 64 20 6f 72 20 74 68 | 61 74 20 68 61 76 65 20 |ed or th|at have |
|00001a80| 68 6f 6c 65 73 20 6f 72 | 20 69 73 6c 61 6e 64 73 |holes or| islands|
|00001a90| 20 63 61 6e 20 61 6c 73 | 6f 20 68 61 76 65 20 61 | can als|o have a|
|00001aa0| 20 62 69 67 20 65 66 66 | 65 63 74 20 75 70 6f 6e | big eff|ect upon|
|00001ab0| 20 74 68 65 20 73 70 65 | 65 64 2c 20 64 65 70 65 | the spe|ed, depe|
|00001ac0| 6e 64 69 6e 67 20 75 70 | 6f 6e 20 68 6f 77 20 63 |nding up|on how c|
|00001ad0| 6f 6d 70 6c 69 63 61 74 | 65 64 20 74 68 65 79 20 |omplicat|ed they |
|00001ae0| 61 72 65 2e 20 20 41 73 | 20 61 20 72 75 6c 65 20 |are. As| a rule |
|00001af0| 6f 66 20 74 68 75 6d 62 | 2c 20 69 66 20 61 20 72 |of thumb|, if a r|
|00001b00| 65 67 69 6f 6e 20 6c 6f | 6f 6b 73 20 6c 69 6b 65 |egion lo|oks like|
|00001b10| 20 69 74 20 73 6c 6f 77 | 73 20 5f 43 6f 70 79 42 | it slow|s _CopyB|
|00001b20| 69 74 73 2c 20 69 74 20 | 70 72 6f 62 61 62 6c 79 |its, it |probably|
|00001b30| 20 64 6f 65 73 2e 0d 4d | 6f 64 69 66 79 69 6e 67 | does..M|odifying|
|00001b40| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 74 65 | the sta|ndard te|
|00001b50| 73 74 20 73 6f 20 74 68 | 65 20 6d 61 73 6b 52 67 |st so th|e maskRg|
|00001b60| 6e 20 69 73 20 73 65 74 | 20 74 6f 20 61 20 63 69 |n is set| to a ci|
|00001b70| 72 63 6c 65 20 74 68 61 | 74 20 69 6e 73 63 72 69 |rcle tha|t inscri|
|00001b80| 62 65 73 20 74 68 65 20 | 65 78 61 6d 70 6c 65 20 |bes the |example |
|00001b90| 70 69 78 65 6c 20 6d 61 | 70 20 72 65 73 75 6c 74 |pixel ma|p result|
|00001ba0| 73 20 69 6e 20 61 20 74 | 69 6d 65 20 6f 66 20 33 |s in a t|ime of 3|
|00001bb0| 30 33 20 74 69 63 6b 73 | 2c 20 77 68 69 63 68 20 |03 ticks|, which |
|00001bc0| 69 73 20 63 6f 6e 73 69 | 64 65 72 61 62 6c 79 20 |is consi|derably |
|00001bd0| 6c 6f 6e 67 65 72 20 74 | 68 61 6e 20 74 68 65 20 |longer t|han the |
|00001be0| 73 74 61 6e 64 61 72 64 | 20 74 65 73 74 20 72 65 |standard| test re|
|00001bf0| 73 75 6c 74 20 6f 66 20 | 32 30 34 20 74 69 63 6b |sult of |204 tick|
|00001c00| 73 20 74 68 61 74 20 69 | 6e 76 6f 6c 76 65 64 20 |s that i|nvolved |
|00001c10| 63 6f 70 79 69 6e 67 20 | 61 20 6d 75 63 68 20 6c |copying |a much l|
|00001c20| 61 72 67 65 72 20 61 72 | 65 61 2e 20 20 4d 6f 64 |arger ar|ea. Mod|
|00001c30| 69 66 79 69 6e 67 20 74 | 68 65 20 6d 61 73 6b 52 |ifying t|he maskR|
|00001c40| 67 6e 20 74 6f 20 61 20 | 73 71 75 61 72 65 20 77 |gn to a |square w|
|00001c50| 69 74 68 20 32 32 36 20 | 70 69 78 65 6c 73 20 70 |ith 226 |pixels p|
|00001c60| 65 72 20 73 69 64 65 2c | 20 77 68 69 63 68 20 68 |er side,| which h|
|00001c70| 61 73 20 61 62 6f 75 74 | 20 74 68 65 20 73 61 6d |as about| the sam|
|00001c80| 65 20 74 6f 74 61 6c 20 | 61 72 65 61 20 6f 66 20 |e total |area of |
|00001c90| 74 68 65 20 63 69 72 63 | 6c 65 20 6a 75 73 74 20 |the circ|le just |
|00001ca0| 75 73 65 64 2c 20 72 65 | 73 75 6c 74 73 20 69 6e |used, re|sults in|
|00001cb0| 20 61 20 74 69 6d 65 20 | 6f 66 20 31 37 36 20 74 | a time |of 176 t|
|00001cc0| 69 63 6b 73 2e 0d 54 72 | 61 6e 73 66 65 72 20 4d |icks..Tr|ansfer M|
|00001cd0| 6f 64 65 73 0d 4d 61 63 | 69 6e 74 6f 73 68 65 73 |odes.Mac|intoshes|
|00001ce0| 20 77 69 74 68 6f 75 74 | 20 43 6f 6c 6f 72 20 51 | without| Color Q|
|00001cf0| 75 69 63 6b 44 72 61 77 | 20 68 61 76 65 20 65 69 |uickDraw| have ei|
|00001d00| 67 68 74 20 74 72 61 6e | 73 66 65 72 20 6d 6f 64 |ght tran|sfer mod|
|00001d10| 65 73 20 74 68 61 74 20 | 77 6f 72 6b 20 77 69 74 |es that |work wit|
|00001d20| 68 20 5f 43 6f 70 79 42 | 69 74 73 2c 20 77 68 69 |h _CopyB|its, whi|
|00001d30| 6c 65 20 74 68 6f 73 65 | 20 4d 61 63 69 6e 74 6f |le those| Macinto|
|00001d40| 73 68 65 73 20 77 69 74 | 68 20 43 6f 6c 6f 72 20 |shes wit|h Color |
|00001d50| 51 75 69 63 6b 44 72 61 | 77 20 67 65 74 20 61 6e |QuickDra|w get an|
|00001d60| 20 61 64 64 69 74 69 6f | 6e 61 6c 20 6e 69 6e 65 | additio|nal nine|
|00001d70| 20 6d 6f 64 65 73 2e 20 | 20 42 65 63 61 75 73 65 | modes. | Because|
|00001d80| 20 74 68 65 20 61 6c 67 | 6f 72 69 74 68 6d 73 20 | the alg|orithms |
|00001d90| 66 6f 72 20 65 61 63 68 | 20 6f 66 20 74 68 65 73 |for each| of thes|
|00001da0| 65 20 6d 6f 64 65 73 20 | 63 61 6e 20 62 65 20 70 |e modes |can be p|
|00001db0| 72 65 74 74 79 20 64 69 | 66 66 65 72 65 6e 74 20 |retty di|fferent |
|00001dc0| 66 72 6f 6d 20 74 68 65 | 20 6f 74 68 65 72 73 2c |from the| others,|
|00001dd0| 20 74 68 65 20 74 69 6d | 65 20 69 74 20 74 61 6b | the tim|e it tak|
|00001de0| 65 73 20 5f 43 6f 70 79 | 42 69 74 73 20 74 6f 20 |es _Copy|Bits to |
|00001df0| 77 6f 72 6b 20 77 69 74 | 68 20 65 61 63 68 20 6f |work wit|h each o|
|00001e00| 66 20 74 68 65 73 65 20 | 6d 6f 64 65 73 20 63 61 |f these |modes ca|
|00001e10| 6e 20 76 61 72 79 20 72 | 61 64 69 63 61 6c 6c 79 |n vary r|adically|
|00001e20| 2e 20 20 46 6f 72 20 73 | 65 76 65 72 61 6c 20 6f |. For s|everal o|
|00001e30| 66 20 74 68 65 73 65 20 | 6d 6f 64 65 73 2c 20 74 |f these |modes, t|
|00001e40| 68 65 20 73 70 65 65 64 | 20 6f 66 20 5f 43 6f 70 |he speed| of _Cop|
|00001e50| 79 42 69 74 73 20 63 61 | 6e 20 76 61 72 79 20 61 |yBits ca|n vary a|
|00001e60| 20 6c 6f 74 20 64 65 70 | 65 6e 64 69 6e 67 20 75 | lot dep|ending u|
|00001e70| 70 6f 6e 20 74 68 65 20 | 70 61 72 74 69 63 75 6c |pon the |particul|
|00001e80| 61 72 20 69 6d 61 67 65 | 20 62 65 69 6e 67 20 63 |ar image| being c|
|00001e90| 6f 70 69 65 64 20 61 6e | 64 20 74 68 65 20 69 6d |opied an|d the im|
|00001ea0| 61 67 65 20 6f 76 65 72 | 20 77 68 69 63 68 20 74 |age over| which t|
|00001eb0| 68 69 73 20 69 6d 61 67 | 65 20 69 73 20 63 6f 70 |his imag|e is cop|
|00001ec0| 69 65 64 2e 20 20 49 74 | 20 63 61 6e 20 61 6c 73 |ied. It| can als|
|00001ed0| 6f 20 76 61 72 79 20 6e | 6f 6e 2d 6c 69 6e 65 61 |o vary n|on-linea|
|00001ee0| 72 6c 79 20 64 65 70 65 | 6e 64 69 6e 67 20 75 70 |rly depe|nding up|
|00001ef0| 6f 6e 20 74 68 65 20 64 | 65 70 74 68 20 6f 66 20 |on the d|epth of |
|00001f00| 74 68 65 20 70 69 78 65 | 6c 20 6d 61 70 73 2e 20 |the pixe|l maps. |
|00001f10| 20 54 68 65 20 61 72 69 | 74 68 6d 65 74 69 63 20 | The ari|thmetic |
|00001f20| 6d 6f 64 65 73 20 69 6e | 20 70 61 72 74 69 63 75 |modes in| particu|
|00001f30| 6c 61 72 20 61 72 65 20 | 68 69 67 68 6c 79 20 6f |lar are |highly o|
|00001f40| 70 74 69 6d 69 7a 65 64 | 20 66 6f 72 20 33 32 2d |ptimized| for 32-|
|00001f50| 62 69 74 20 64 65 65 70 | 20 70 69 78 65 6c 20 6d |bit deep| pixel m|
|00001f60| 61 70 73 2e 0d 54 68 65 | 20 73 74 61 6e 64 61 72 |aps..The| standar|
|00001f70| 64 20 74 65 73 74 20 63 | 6f 70 69 65 73 20 61 20 |d test c|opies a |
|00001f80| 66 61 69 72 6c 79 20 61 | 76 65 72 61 67 65 2d 6c |fairly a|verage-l|
|00001f90| 6f 6f 6b 69 6e 67 20 72 | 61 79 2d 74 72 61 63 65 |ooking r|ay-trace|
|00001fa0| 64 20 69 6d 61 67 65 20 | 74 6f 20 61 20 77 68 69 |d image |to a whi|
|00001fb0| 74 65 20 62 61 63 6b 67 | 72 6f 75 6e 64 2e 20 20 |te backg|round. |
|00001fc0| 4d 6f 64 69 66 79 69 6e | 67 20 74 68 65 20 73 74 |Modifyin|g the st|
|00001fd0| 61 6e 64 61 72 64 20 74 | 65 73 74 20 74 6f 20 65 |andard t|est to e|
|00001fe0| 72 61 73 65 20 74 68 65 | 20 62 61 63 6b 67 72 6f |rase the| backgro|
|00001ff0| 75 6e 64 20 62 65 74 77 | 65 65 6e 20 65 61 63 68 |und betw|een each|
|00002000| 20 6f 66 20 74 68 65 20 | 31 30 30 20 63 61 6c 6c | of the |100 call|
|00002010| 73 20 74 6f 20 5f 43 6f | 70 79 42 69 74 73 20 70 |s to _Co|pyBits p|
|00002020| 72 6f 64 75 63 65 64 20 | 74 68 65 20 66 6f 6c 6c |roduced |the foll|
|00002030| 6f 77 69 6e 67 20 72 65 | 73 75 6c 74 73 20 66 6f |owing re|sults fo|
|00002040| 72 20 74 68 65 20 6d 6f | 64 65 73 20 6c 69 73 74 |r the mo|des list|
|00002050| 65 64 20 28 74 68 65 20 | 74 65 73 74 73 20 77 65 |ed (the |tests we|
|00002060| 72 65 20 6f 62 76 69 6f | 75 73 6c 79 20 61 6c 73 |re obvio|usly als|
|00002070| 6f 20 63 68 61 6e 67 65 | 64 20 74 6f 20 72 65 66 |o change|d to ref|
|00002080| 6c 65 63 74 20 74 68 65 | 20 70 72 6f 70 65 72 20 |lect the| proper |
|00002090| 6d 6f 64 65 2e 20 20 49 | 6e 20 61 64 64 69 74 69 |mode. I|n additi|
|000020a0| 6f 6e 2c 20 74 6f 20 6d | 61 6b 65 20 74 68 65 20 |on, to m|ake the |
|000020b0| 72 65 73 75 6c 74 73 20 | 61 20 6c 69 74 74 6c 65 |results |a little|
|000020c0| 20 6d 6f 72 65 20 6d 65 | 61 6e 69 6e 67 66 75 6c | more me|aningful|
|000020d0| 2c 20 74 68 65 20 74 69 | 6d 65 20 69 74 20 74 6f |, the ti|me it to|
|000020e0| 6f 6b 20 74 6f 20 65 72 | 61 73 65 20 74 68 65 20 |ok to er|ase the |
|000020f0| 62 61 63 6b 67 72 6f 75 | 6e 64 20 68 61 73 20 62 |backgrou|nd has b|
|00002100| 65 65 6e 20 73 75 62 74 | 72 61 63 74 65 64 20 66 |een subt|racted f|
|00002110| 72 6f 6d 20 65 61 63 68 | 20 72 65 73 75 6c 74 2e |rom each| result.|
|00002120| 0d 73 72 63 43 6f 70 79 | 09 32 30 34 09 6e 6f 74 |.srcCopy|.204.not|
|00002130| 53 72 63 43 6f 70 79 09 | 34 36 39 09 61 64 64 4f |SrcCopy.|469.addO|
|00002140| 76 65 72 09 31 35 30 30 | 09 61 64 4d 61 78 09 31 |ver.1500|.adMax.1|
|00002150| 35 30 34 0d 73 72 63 4f | 72 09 34 33 36 09 6e 6f |504.srcO|r.436.no|
|00002160| 74 53 72 63 4f 72 09 34 | 34 34 09 61 64 64 50 69 |tSrcOr.4|44.addPi|
|00002170| 6e 09 31 35 31 34 09 61 | 64 4d 69 6e 09 31 35 30 |n.1514.a|dMin.150|
|00002180| 31 0d 73 72 63 42 69 63 | 09 34 34 31 09 6e 6f 74 |1.srcBic|.441.not|
|00002190| 53 72 63 42 69 63 09 34 | 34 31 09 73 75 62 4f 76 |SrcBic.4|41.subOv|
|000021a0| 65 72 09 31 34 39 33 09 | 62 6c 65 6e 64 09 31 35 |er.1493.|blend.15|
|000021b0| 35 33 0d 73 72 63 58 6f | 72 09 34 33 38 09 6e 6f |53.srcXo|r.438.no|
|000021c0| 74 53 72 63 58 6f 72 09 | 34 33 36 09 73 75 62 50 |tSrcXor.|436.subP|
|000021d0| 69 6e 09 31 35 32 35 09 | 74 72 61 6e 73 70 61 72 |in.1525.|transpar|
|000021e0| 65 6e 74 09 31 31 30 37 | 0d 09 09 09 09 09 09 68 |ent.1107|.......h|
|000021f0| 69 6c 69 74 65 09 33 31 | 32 37 0d 4f 66 20 63 6f |ilite.31|27.Of co|
|00002200| 75 72 73 65 2c 20 74 68 | 65 20 61 6d 6f 75 6e 74 |urse, th|e amount|
|00002210| 20 6f 66 20 74 69 6d 65 | 20 74 61 6b 65 6e 20 62 | of time| taken b|
|00002220| 79 20 73 6f 6d 65 20 6f | 66 20 74 68 65 73 65 20 |y some o|f these |
|00002230| 6d 6f 64 65 73 20 63 61 | 6e 20 62 65 20 63 68 61 |modes ca|n be cha|
|00002240| 6e 67 65 64 20 62 79 20 | 63 68 61 6e 67 69 6e 67 |nged by |changing|
|00002250| 20 74 68 65 20 69 6d 61 | 67 65 20 74 6f 20 63 6f | the ima|ge to co|
|00002260| 70 79 20 61 6e 64 20 74 | 68 65 20 69 6d 61 67 65 |py and t|he image|
|00002270| 20 6f 76 65 72 20 77 68 | 69 63 68 20 69 74 20 69 | over wh|ich it i|
|00002280| 73 20 63 6f 70 69 65 64 | 2e 20 20 54 68 65 73 65 |s copied|. These|
|00002290| 20 66 69 67 75 72 65 73 | 20 61 72 65 20 6a 75 73 | figures| are jus|
|000022a0| 74 20 74 6f 20 67 69 76 | 65 20 61 6e 20 69 64 65 |t to giv|e an ide|
|000022b0| 61 20 6f 66 20 68 6f 77 | 20 66 61 73 74 20 6f 72 |a of how| fast or|
|000022c0| 20 73 6c 6f 77 20 73 6f | 6d 65 20 6f 66 20 74 68 | slow so|me of th|
|000022d0| 65 73 65 20 6d 6f 64 65 | 73 20 61 72 65 20 69 6e |ese mode|s are in|
|000022e0| 20 74 68 69 73 20 70 61 | 72 74 69 63 75 6c 61 72 | this pa|rticular|
|000022f0| 20 73 69 74 75 61 74 69 | 6f 6e 2e 0d 54 68 65 72 | situati|on..Ther|
|00002300| 65 20 69 73 20 61 63 74 | 75 61 6c 6c 79 20 6f 6e |e is act|ually on|
|00002310| 65 20 6d 6f 72 65 20 6d | 6f 64 65 20 77 68 69 63 |e more m|ode whic|
|00002320| 68 20 69 73 20 6e 6f 74 | 20 6d 65 6e 74 69 6f 6e |h is not| mention|
|00002330| 65 64 3a 20 20 64 69 74 | 68 65 72 43 6f 70 79 2e |ed: dit|herCopy.|
|00002340| 20 20 41 70 70 6c 65 20 | 69 6e 74 72 6f 64 75 63 | Apple |introduc|
|00002350| 65 64 20 74 68 69 73 20 | 6d 6f 64 65 20 77 69 74 |ed this |mode wit|
|00002360| 68 20 33 32 2d 42 69 74 | 20 51 75 69 63 6b 44 72 |h 32-Bit| QuickDr|
|00002370| 61 77 2c 20 61 6e 64 20 | 69 74 20 6d 61 6b 65 73 |aw, and |it makes|
|00002380| 20 5f 43 6f 70 79 42 69 | 74 73 20 64 6f 20 65 72 | _CopyBi|ts do er|
|00002390| 72 6f 72 2d 64 69 66 66 | 75 73 69 6f 6e 20 64 69 |ror-diff|usion di|
|000023a0| 74 68 65 72 69 6e 67 20 | 77 68 65 6e 20 63 6f 70 |thering |when cop|
|000023b0| 79 69 6e 67 20 61 20 70 | 69 78 65 6c 20 6d 61 70 |ying a p|ixel map|
|000023c0| 20 66 72 6f 6d 20 6f 6e | 65 20 64 65 70 74 68 20 | from on|e depth |
|000023d0| 74 6f 20 61 20 70 69 78 | 65 6c 20 6d 61 70 20 6f |to a pix|el map o|
|000023e0| 66 20 61 20 6c 65 73 73 | 65 72 20 64 65 70 74 68 |f a less|er depth|
|000023f0| 20 6f 72 20 74 6f 20 61 | 20 70 69 78 65 6c 20 6d | or to a| pixel m|
|00002400| 61 70 20 6f 66 20 74 68 | 65 20 73 61 6d 65 20 64 |ap of th|e same d|
|00002410| 65 70 74 68 20 77 69 74 | 68 20 61 20 64 69 66 66 |epth wit|h a diff|
|00002420| 65 72 65 6e 74 20 63 6f | 6c 6f 72 20 74 61 62 6c |erent co|lor tabl|
|00002430| 65 2e 20 20 54 68 65 20 | 73 70 65 65 64 20 6f 66 |e. The |speed of|
|00002440| 20 74 68 69 73 20 74 72 | 61 6e 73 66 65 72 20 6d | this tr|ansfer m|
|00002450| 6f 64 65 20 63 61 6e 20 | 62 65 20 76 65 72 79 20 |ode can |be very |
|00002460| 66 61 73 74 20 6f 72 20 | 76 65 72 79 20 73 6c 6f |fast or |very slo|
|00002470| 77 2c 20 64 65 70 65 6e | 64 69 6e 67 20 75 70 6f |w, depen|ding upo|
|00002480| 6e 20 77 68 61 74 20 70 | 69 78 65 6c 20 64 65 70 |n what p|ixel dep|
|00002490| 74 68 73 20 61 6e 64 20 | 63 6f 6c 6f 72 73 20 61 |ths and |colors a|
|000024a0| 72 65 20 75 73 65 64 20 | 61 6e 64 20 74 68 65 20 |re used |and the |
|000024b0| 70 61 72 74 69 63 75 6c | 61 72 20 69 6d 61 67 65 |particul|ar image|
|000024c0| 20 62 65 69 6e 67 20 63 | 6f 70 69 65 64 2e 20 20 | being c|opied. |
|000024d0| 54 68 65 20 64 69 74 68 | 65 72 43 6f 70 79 20 6d |The dith|erCopy m|
|000024e0| 6f 64 65 20 69 73 20 6e | 6f 74 20 69 6e 63 6c 75 |ode is n|ot inclu|
|000024f0| 64 65 64 20 69 6e 20 74 | 68 65 20 74 61 62 6c 65 |ded in t|he table|
|00002500| 20 73 69 6e 63 65 20 74 | 68 65 20 72 61 6e 67 65 | since t|he range|
|00002510| 20 6f 66 20 66 69 67 75 | 72 65 73 20 69 73 20 70 | of figu|res is p|
|00002520| 6f 74 65 6e 74 69 61 6c | 6c 79 20 76 65 72 79 20 |otential|ly very |
|00002530| 6c 61 72 67 65 3b 20 70 | 6c 61 79 20 77 69 74 68 |large; p|lay with|
|00002540| 20 69 74 20 61 6e 64 20 | 73 65 65 20 66 6f 72 20 | it and |see for |
|00002550| 79 6f 75 72 73 65 6c 66 | 2e 20 20 46 6f 72 20 6d |yourself|. For m|
|00002560| 6f 72 65 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |ore info|rmation |
|00002570| 61 62 6f 75 74 20 74 68 | 69 73 20 6d 6f 64 65 2c |about th|is mode,|
|00002580| 20 72 65 66 65 72 20 74 | 6f 20 74 68 65 20 43 6f | refer t|o the Co|
|00002590| 6c 6f 72 20 51 75 69 63 | 6b 44 72 61 77 20 63 68 |lor Quic|kDraw ch|
|000025a0| 61 70 74 65 72 20 69 6e | 20 49 6e 73 69 64 65 20 |apter in| Inside |
|000025b0| 4d 61 63 69 6e 74 6f 73 | 68 2c 20 56 6f 6c 75 6d |Macintos|h, Volum|
|000025c0| 65 20 56 49 20 61 6e 64 | 20 74 68 65 20 33 32 2d |e VI and| the 32-|
|000025d0| 42 69 74 20 51 75 69 63 | 6b 44 72 61 77 20 44 65 |Bit Quic|kDraw De|
|000025e0| 76 65 6c 6f 70 65 72 73 | d5 20 4e 6f 74 65 73 20 |velopers|. Notes |
|000025f0| 66 72 6f 6d 20 41 50 44 | 41 2e 0d 43 6f 6c 6f 72 |from APD|A..Color|
|00002600| 69 7a 61 74 69 6f 6e 0d | 54 68 65 72 65 20 69 73 |ization.|There is|
|00002610| 20 61 20 76 61 72 69 61 | 74 69 6f 6e 20 6f 66 20 | a varia|tion of |
|00002620| 5f 43 6f 70 79 42 69 74 | 73 20 69 66 20 74 68 65 |_CopyBit|s if the|
|00002630| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 70 69 78 | destina|tion pix|
|00002640| 65 6c 20 6d 61 70 20 69 | 73 20 74 68 65 20 63 75 |el map i|s the cu|
|00002650| 72 72 65 6e 74 20 70 6f | 72 74 20 61 6e 64 20 74 |rrent po|rt and t|
|00002660| 68 65 20 66 6f 72 65 67 | 72 6f 75 6e 64 20 63 6f |he foreg|round co|
|00002670| 6c 6f 72 20 69 73 20 6e | 6f 74 20 62 6c 61 63 6b |lor is n|ot black|
|00002680| 20 6f 72 20 74 68 65 20 | 62 61 63 6b 67 72 6f 75 | or the |backgrou|
|00002690| 6e 64 20 63 6f 6c 6f 72 | 20 69 73 20 6e 6f 74 20 |nd color| is not |
|000026a0| 77 68 69 74 65 2e 20 20 | 49 66 20 74 68 69 73 20 |white. |If this |
|000026b0| 69 73 20 74 68 65 20 63 | 61 73 65 2c 20 74 68 65 |is the c|ase, the|
|000026c0| 6e 20 74 68 65 20 73 6f | 75 72 63 65 20 69 6d 61 |n the so|urce ima|
|000026d0| 67 65 20 69 73 20 63 6f | 6c 6f 72 69 7a 65 64 20 |ge is co|lorized |
|000026e0| 77 68 65 6e 20 69 74 d5 | 73 20 63 6f 70 69 65 64 |when it.|s copied|
|000026f0| 2e 20 20 46 6f 72 20 64 | 65 74 61 69 6c 73 2c 20 |. For d|etails, |
|00002700| 73 65 65 20 54 65 63 68 | 6e 69 63 61 6c 20 4e 6f |see Tech|nical No|
|00002710| 74 65 20 23 31 36 33 2c | 20 41 64 64 69 6e 67 20 |te #163,| Adding |
|00002720| 43 6f 6c 6f 72 20 77 69 | 74 68 20 5f 43 6f 70 79 |Color wi|th _Copy|
|00002730| 42 69 74 73 2e 20 20 42 | 65 63 61 75 73 65 20 74 |Bits. B|ecause t|
|00002740| 68 69 73 20 63 6f 6c 6f | 72 69 7a 61 74 69 6f 6e |his colo|rization|
|00002750| 20 72 65 71 75 69 72 65 | 73 20 65 78 74 72 61 20 | require|s extra |
|00002760| 70 72 6f 63 65 73 73 69 | 6e 67 2c 20 5f 43 6f 70 |processi|ng, _Cop|
|00002770| 79 42 69 74 73 20 73 6c | 6f 77 73 20 64 6f 77 6e |yBits sl|ows down|
|00002780| 2e 20 20 54 6f 20 6b 65 | 65 70 20 5f 43 6f 70 79 |. To ke|ep _Copy|
|00002790| 42 69 74 73 20 61 73 20 | 66 61 73 74 20 61 73 20 |Bits as |fast as |
|000027a0| 70 6f 73 73 69 62 6c 65 | 2c 20 6d 61 6b 65 20 73 |possible|, make s|
|000027b0| 75 72 65 20 74 68 65 20 | 66 6f 72 65 67 72 6f 75 |ure the |foregrou|
|000027c0| 6e 64 20 63 6f 6c 6f 72 | 20 69 73 20 62 6c 61 63 |nd color| is blac|
|000027d0| 6b 2c 20 74 68 65 20 62 | 61 63 6b 67 72 6f 75 6e |k, the b|ackgroun|
|000027e0| 64 20 63 6f 6c 6f 72 20 | 69 73 20 77 68 69 74 65 |d color |is white|
|000027f0| 2c 20 61 6e 64 20 74 68 | 61 74 20 74 68 65 20 63 |, and th|at the c|
|00002800| 75 72 72 65 6e 74 20 47 | 44 65 76 69 63 65 20 70 |urrent G|Device p|
|00002810| 69 78 65 6c 20 6d 61 70 | d5 73 20 63 6f 6c 6f 72 |ixel map|.s color|
|00002820| 20 74 61 62 6c 65 20 68 | 61 73 20 77 68 69 74 65 | table h|as white|
|00002830| 20 69 6e 20 74 68 65 20 | 66 69 72 73 74 20 70 6f | in the |first po|
|00002840| 73 69 74 69 6f 6e 20 61 | 6e 64 20 62 6c 61 63 6b |sition a|nd black|
|00002850| 20 69 6e 20 74 68 65 20 | 6c 61 73 74 20 70 6f 73 | in the |last pos|
|00002860| 69 74 69 6f 6e 2e 0d 4d | 6f 64 69 66 79 69 6e 67 |ition..M|odifying|
|00002870| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 74 65 | the sta|ndard te|
|00002880| 73 74 20 73 6f 20 74 68 | 61 74 20 74 68 65 20 66 |st so th|at the f|
|00002890| 6f 72 65 67 72 6f 75 6e | 64 20 63 6f 6c 6f 72 20 |oregroun|d color |
|000028a0| 69 73 20 70 75 72 65 20 | 72 65 64 20 61 6e 64 20 |is pure |red and |
|000028b0| 74 68 65 20 62 61 63 6b | 67 72 6f 75 6e 64 20 63 |the back|ground c|
|000028c0| 6f 6c 6f 72 20 70 75 72 | 65 20 62 6c 75 65 20 70 |olor pur|e blue p|
|000028d0| 72 6f 64 75 63 65 73 20 | 61 20 72 65 73 75 6c 74 |roduces |a result|
|000028e0| 20 6f 66 20 35 37 39 20 | 74 69 63 6b 73 2e 0d 50 | of 579 |ticks..P|
|000028f0| 69 78 65 6c 20 41 6c 69 | 67 6e 6d 65 6e 74 0d 54 |ixel Ali|gnment.T|
|00002900| 68 65 20 61 6c 69 67 6e | 6d 65 6e 74 20 6f 66 20 |he align|ment of |
|00002910| 70 69 78 65 6c 73 20 69 | 6e 20 74 68 65 20 73 6f |pixels i|n the so|
|00002920| 75 72 63 65 20 70 69 78 | 65 6c 20 6d 61 70 20 72 |urce pix|el map r|
|00002930| 65 6c 61 74 69 76 65 20 | 74 6f 20 74 68 65 69 72 |elative |to their|
|00002940| 20 61 6c 69 67 6e 6d 65 | 6e 74 20 74 68 65 20 64 | alignme|nt the d|
|00002950| 65 73 74 69 6e 61 74 69 | 6f 6e 20 70 69 78 65 6c |estinati|on pixel|
|00002960| 20 6d 61 70 20 63 61 6e | 20 62 65 20 73 75 72 70 | map can| be surp|
|00002970| 72 69 73 69 6e 67 6c 79 | 20 69 6d 70 6f 72 74 61 |risingly| importa|
|00002980| 6e 74 20 74 6f 20 74 68 | 65 20 73 70 65 65 64 20 |nt to th|e speed |
|00002990| 6f 66 20 5f 43 6f 70 79 | 42 69 74 73 2c 20 62 75 |of _Copy|Bits, bu|
|000029a0| 74 20 77 68 61 74 20 69 | 73 20 70 69 78 65 6c 20 |t what i|s pixel |
|000029b0| 61 6c 69 67 6e 6d 65 6e | 74 3f 20 20 46 6f 6c 6c |alignmen|t? Foll|
|000029c0| 6f 77 69 6e 67 20 69 73 | 20 61 6e 20 65 78 61 6d |owing is| an exam|
|000029d0| 70 6c 65 20 74 6f 20 64 | 65 6d 6f 6e 73 74 72 61 |ple to d|emonstra|
|000029e0| 74 65 20 74 68 65 20 63 | 6f 6e 63 65 70 74 20 6f |te the c|oncept o|
|000029f0| 66 20 70 69 78 65 6c 20 | 61 6c 69 67 6e 6d 65 6e |f pixel |alignmen|
|00002a00| 74 2e 20 20 49 6d 61 67 | 69 6e 65 20 79 6f 75 20 |t. Imag|ine you |
|00002a10| 77 61 6e 74 20 74 6f 20 | 70 65 72 66 6f 72 6d 20 |want to |perform |
|00002a20| 61 20 5f 43 6f 70 79 42 | 69 74 73 20 6f 6e 20 61 |a _CopyB|its on a|
|00002a30| 20 6f 6e 65 2d 62 69 74 | 2d 70 65 72 2d 70 69 78 | one-bit|-per-pix|
|00002a40| 65 6c 20 6f 66 66 2d 73 | 63 72 65 65 6e 20 70 69 |el off-s|creen pi|
|00002a50| 78 65 6c 20 6d 61 70 20 | 69 6e 74 6f 20 61 20 77 |xel map |into a w|
|00002a60| 69 6e 64 6f 77 20 6f 6e | 20 61 20 6f 6e 65 2d 62 |indow on| a one-b|
|00002a70| 69 74 2d 70 65 72 2d 70 | 69 78 65 6c 20 73 63 72 |it-per-p|ixel scr|
|00002a80| 65 65 6e 2c 20 61 6e 64 | 20 74 68 65 20 77 69 6e |een, and| the win|
|00002a90| 64 6f 77 20 69 73 20 74 | 68 72 65 65 20 70 69 78 |dow is t|hree pix|
|00002aa0| 65 6c 73 20 66 72 6f 6d | 20 74 68 65 20 6c 65 66 |els from| the lef|
|00002ab0| 74 20 65 64 67 65 20 6f | 66 20 74 68 65 20 73 63 |t edge o|f the sc|
|00002ac0| 72 65 65 6e 2e 0d 49 66 | 20 79 6f 75 20 63 6f 70 |reen..If| you cop|
|00002ad0| 79 20 74 68 65 20 65 6e | 74 69 72 65 20 6f 66 66 |y the en|tire off|
|00002ae0| 2d 73 63 72 65 65 6e 20 | 70 69 78 65 6c 20 6d 61 |-screen |pixel ma|
|00002af0| 70 20 74 6f 20 74 68 65 | 20 6c 65 66 74 20 65 64 |p to the| left ed|
|00002b00| 67 65 20 6f 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |ge of th|e window|
|00002b10| 2c 20 74 68 65 6e 20 5f | 43 6f 70 79 42 69 74 73 |, then _|CopyBits|
|00002b20| 20 6d 75 73 74 20 72 65 | 61 6c 69 67 6e 20 74 68 | must re|align th|
|00002b30| 65 20 70 69 78 65 6c 73 | 2e 20 20 53 69 6e 63 65 |e pixels|. Since|
|00002b40| 20 74 68 65 20 6c 65 66 | 74 6d 6f 73 74 20 70 69 | the lef|tmost pi|
|00002b50| 78 65 6c 73 20 6f 66 20 | 74 68 65 20 6f 66 66 2d |xels of |the off-|
|00002b60| 73 63 72 65 65 6e 20 70 | 69 78 65 6c 20 6d 61 70 |screen p|ixel map|
|00002b70| 20 61 72 65 20 6f 6e 20 | 61 20 62 79 74 65 20 62 | are on |a byte b|
|00002b80| 6f 75 6e 64 61 72 79 2c | 20 62 75 74 20 74 68 65 |oundary,| but the|
|00002b90| 20 6c 65 66 74 20 65 64 | 67 65 20 6f 66 20 74 68 | left ed|ge of th|
|00002ba0| 65 20 77 69 6e 64 6f 77 | 20 69 73 20 74 68 72 65 |e window| is thre|
|00002bb0| 65 20 70 69 78 65 6c 73 | 20 61 77 61 79 20 66 72 |e pixels| away fr|
|00002bc0| 6f 6d 20 61 20 62 79 74 | 65 20 62 6f 75 6e 64 61 |om a byt|e bounda|
|00002bd0| 72 79 2c 20 5f 43 6f 70 | 79 42 69 74 73 20 68 61 |ry, _Cop|yBits ha|
|00002be0| 73 20 74 6f 20 73 68 69 | 66 74 20 28 6f 72 20 72 |s to shi|ft (or r|
|00002bf0| 65 61 6c 69 67 6e 29 20 | 65 61 63 68 20 62 79 74 |ealign) |each byt|
|00002c00| 65 20 66 72 6f 6d 20 74 | 68 65 20 6f 66 66 2d 73 |e from t|he off-s|
|00002c10| 63 72 65 65 6e 20 70 69 | 78 65 6c 20 6d 61 70 20 |creen pi|xel map |
|00002c20| 62 79 20 74 68 72 65 65 | 20 70 69 78 65 6c 73 20 |by three| pixels |
|00002c30| 62 65 66 6f 72 65 20 70 | 6c 61 63 69 6e 67 20 69 |before p|lacing i|
|00002c40| 74 20 6f 6e 20 74 68 65 | 20 73 63 72 65 65 6e 2e |t on the| screen.|
|00002c50| 20 20 54 68 65 20 70 72 | 6f 63 65 73 73 20 6f 66 | The pr|ocess of|
|00002c60| 20 61 6c 69 67 6e 69 6e | 67 20 74 68 65 20 70 69 | alignin|g the pi|
|00002c70| 78 65 6c 73 20 73 6c 6f | 77 73 20 64 6f 77 6e 20 |xels slo|ws down |
|00002c80| 5f 43 6f 70 79 42 69 74 | 73 2e 0d 46 69 67 75 72 |_CopyBit|s..Figur|
|00002c90| 65 20 31 20 73 68 6f 77 | 73 20 61 6e 20 65 78 61 |e 1 show|s an exa|
|00002ca0| 6d 70 6c 65 20 6f 66 20 | 74 68 69 73 20 72 65 61 |mple of |this rea|
|00002cb0| 6c 69 67 6e 6d 65 6e 74 | 2e 20 20 41 6e 20 6f 66 |lignment|. An of|
|00002cc0| 66 2d 73 63 72 65 65 6e | 20 62 69 74 20 6d 61 70 |f-screen| bit map|
|00002cd0| 20 73 70 65 63 69 66 69 | 65 64 20 62 79 20 61 20 | specifi|ed by a |
|00002ce0| 70 6f 69 6e 74 65 72 20 | 74 6f 20 61 20 42 69 74 |pointer |to a Bit|
|00002cf0| 4d 61 70 20 63 61 6c 6c | 65 64 20 6f 66 66 53 63 |Map call|ed offSc|
|00002d00| 72 65 65 6e 20 69 73 20 | 62 65 69 6e 67 20 63 6f |reen is |being co|
|00002d10| 70 69 65 64 20 74 6f 20 | 61 20 77 69 6e 64 6f 77 |pied to |a window|
|00002d20| 20 73 70 65 63 69 66 69 | 65 64 20 62 79 20 61 20 | specifi|ed by a |
|00002d30| 57 69 6e 64 6f 77 50 74 | 72 20 63 61 6c 6c 65 64 |WindowPt|r called|
|00002d40| 20 77 69 6e 64 6f 77 2e | 20 20 77 69 6e 64 6f 77 | window.| window|
|00002d50| 2c 20 77 68 69 63 68 20 | 69 73 20 32 35 36 20 70 |, which |is 256 p|
|00002d60| 69 78 65 6c 73 20 77 69 | 64 65 20 61 6e 64 20 32 |ixels wi|de and 2|
|00002d70| 35 36 20 70 69 78 65 6c | 73 20 68 69 67 68 2c 20 |56 pixel|s high, |
|00002d80| 69 73 20 70 6f 73 69 74 | 69 6f 6e 65 64 20 35 30 |is posit|ioned 50|
|00002d90| 20 70 69 78 65 6c 73 20 | 66 72 6f 6d 20 74 68 65 | pixels |from the|
|00002da0| 20 74 6f 70 20 6f 66 20 | 74 68 65 20 73 63 72 65 | top of |the scre|
|00002db0| 65 6e 20 61 6e 64 20 74 | 68 72 65 65 20 70 69 78 |en and t|hree pix|
|00002dc0| 65 6c 73 20 66 72 6f 6d | 20 74 68 65 20 6c 65 66 |els from| the lef|
|00002dd0| 74 20 65 64 67 65 20 6f | 66 20 74 68 65 20 73 63 |t edge o|f the sc|
|00002de0| 72 65 65 6e 2e 20 20 54 | 68 65 20 73 63 72 65 65 |reen. T|he scree|
|00002df0| 6e 20 68 61 73 20 35 31 | 32 20 70 69 78 65 6c 73 |n has 51|2 pixels|
|00002e00| 20 68 6f 72 69 7a 6f 6e | 74 61 6c 6c 79 20 61 6e | horizon|tally an|
|00002e10| 64 20 33 34 32 20 70 69 | 78 65 6c 73 20 76 65 72 |d 342 pi|xels ver|
|00002e20| 74 69 63 61 6c 6c 79 2e | 20 20 54 68 65 20 73 6f |tically.| The so|
|00002e30| 75 72 63 65 20 72 65 63 | 74 61 6e 67 6c 65 20 74 |urce rec|tangle t|
|00002e40| 68 61 74 20 69 73 20 70 | 61 73 73 65 64 20 74 6f |hat is p|assed to|
|00002e50| 20 5f 43 6f 70 79 42 69 | 74 73 20 69 73 20 73 6f | _CopyBi|ts is so|
|00002e60| 75 72 63 65 52 65 63 74 | 20 61 6e 64 20 74 68 65 |urceRect| and the|
|00002e70| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 72 65 63 | destina|tion rec|
|00002e80| 74 61 6e 67 6c 65 20 69 | 73 20 64 65 73 74 69 6e |tangle i|s destin|
|00002e90| 61 74 69 6f 6e 52 65 63 | 74 2e 20 20 42 65 63 61 |ationRec|t. Beca|
|00002ea0| 75 73 65 20 6f 66 66 53 | 63 72 65 65 6e 20 69 73 |use offS|creen is|
|00002eb0| 20 6d 69 73 61 6c 69 67 | 6e 65 64 20 62 79 20 74 | misalig|ned by t|
|00002ec0| 68 72 65 65 20 70 69 78 | 65 6c 73 2c 20 5f 43 6f |hree pix|els, _Co|
|00002ed0| 70 79 42 69 74 73 20 68 | 61 73 20 74 6f 20 73 68 |pyBits h|as to sh|
|00002ee0| 69 66 74 20 6f 66 66 53 | 63 72 65 65 6e 20 62 79 |ift offS|creen by|
|00002ef0| 20 74 68 72 65 65 20 70 | 69 78 65 6c 73 20 62 65 | three p|ixels be|
|00002f00| 66 6f 72 65 20 70 6c 61 | 63 69 6e 67 20 74 68 65 |fore pla|cing the|
|00002f10| 20 69 6d 61 67 65 20 6f | 6e 20 74 68 65 20 73 63 | image o|n the sc|
|00002f20| 72 65 65 6e 2e 0d 46 69 | 67 75 72 65 20 31 d0 6f |reen..Fi|gure 1.o|
|00002f30| 66 66 73 63 72 65 65 6e | 20 4e 65 65 64 73 20 52 |ffscreen| Needs R|
|00002f40| 65 61 6c 69 67 6e 6d 65 | 6e 74 0d 42 79 20 61 64 |ealignme|nt.By ad|
|00002f50| 6a 75 73 74 69 6e 67 20 | 74 68 65 20 6f 66 66 2d |justing |the off-|
|00002f60| 73 63 72 65 65 6e 20 70 | 69 78 65 6c 20 6d 61 70 |screen p|ixel map|
|00002f70| 20 73 6f 20 74 68 61 74 | 20 69 74 73 20 6c 65 66 | so that| its lef|
|00002f80| 74 6d 6f 73 74 20 70 69 | 78 65 6c 73 20 61 72 65 |tmost pi|xels are|
|00002f90| 20 61 6c 73 6f 20 74 68 | 72 65 65 20 70 69 78 65 | also th|ree pixe|
|00002fa0| 6c 73 20 61 77 61 79 20 | 66 72 6f 6d 20 61 20 62 |ls away |from a b|
|00002fb0| 79 74 65 20 62 6f 75 6e | 64 61 72 79 2c 20 5f 43 |yte boun|dary, _C|
|00002fc0| 6f 70 79 42 69 74 73 20 | 63 61 6e 20 6a 75 73 74 |opyBits |can just|
|00002fd0| 20 63 6f 70 79 20 74 68 | 65 20 62 79 74 65 73 20 | copy th|e bytes |
|00002fe0| 77 69 74 68 6f 75 74 20 | 73 68 69 66 74 69 6e 67 |without |shifting|
|00002ff0| 2c 20 77 68 69 63 68 20 | 69 73 20 61 20 6c 6f 74 |, which |is a lot|
|00003000| 20 66 61 73 74 65 72 2e | 20 20 54 68 69 73 20 65 | faster.| This e|
|00003010| 78 61 6d 70 6c 65 20 68 | 6f 6c 64 73 20 74 72 75 |xample h|olds tru|
|00003020| 65 20 6f 6e 20 61 6c 6c | 20 4d 61 63 69 6e 74 6f |e on all| Macinto|
|00003030| 73 68 20 6d 6f 64 65 6c | 73 2c 20 77 68 65 74 68 |sh model|s, wheth|
|00003040| 65 72 20 74 68 65 79 20 | 68 61 76 65 20 43 6f 6c |er they |have Col|
|00003050| 6f 72 20 51 75 69 63 6b | 44 72 61 77 20 6f 72 20 |or Quick|Draw or |
|00003060| 6e 6f 74 2e 20 20 54 6f | 20 6b 65 65 70 20 5f 43 |not. To| keep _C|
|00003070| 6f 70 79 42 69 74 73 20 | 61 73 20 66 61 73 74 20 |opyBits |as fast |
|00003080| 61 73 20 70 6f 73 73 69 | 62 6c 65 2c 20 6d 61 6b |as possi|ble, mak|
|00003090| 65 20 73 75 72 65 20 74 | 68 65 20 70 69 78 65 6c |e sure t|he pixel|
|000030a0| 73 20 69 6e 20 6d 65 6d | 6f 72 79 20 61 72 65 20 |s in mem|ory are |
|000030b0| 61 6c 69 67 6e 65 64 20 | 77 69 74 68 20 74 68 65 |aligned |with the|
|000030c0| 20 70 69 78 65 6c 73 20 | 6f 6e 20 74 68 65 20 73 | pixels |on the s|
|000030d0| 63 72 65 65 6e 2e 20 20 | 46 69 67 75 72 65 20 32 |creen. |Figure 2|
|000030e0| 20 73 68 6f 77 73 20 74 | 68 65 20 73 61 6d 65 20 | shows t|he same |
|000030f0| 73 69 74 75 61 74 69 6f | 6e 20 61 73 20 46 69 67 |situatio|n as Fig|
|00003100| 75 72 65 20 31 2c 20 65 | 78 63 65 70 74 20 74 68 |ure 1, e|xcept th|
|00003110| 61 74 20 6f 66 66 53 63 | 72 65 65 6e 20 69 73 20 |at offSc|reen is |
|00003120| 6e 6f 77 20 70 72 6f 70 | 65 72 6c 79 20 61 6c 69 |now prop|erly ali|
|00003130| 67 6e 65 64 20 74 6f 20 | 77 69 6e 64 6f 77 2e 0d |gned to |window..|
|00003140| 46 69 67 75 72 65 20 32 | d0 6f 66 66 73 63 72 65 |Figure 2|.offscre|
|00003150| 65 6e 20 41 6c 69 67 6e | 65 64 0d 4d 61 6e 79 2c |en Align|ed.Many,|
|00003160| 20 69 66 20 6e 6f 74 20 | 6d 6f 73 74 2c 20 43 6f | if not |most, Co|
|00003170| 6c 6f 72 20 51 75 69 63 | 6b 44 72 61 77 20 4d 61 |lor Quic|kDraw Ma|
|00003180| 63 69 6e 74 6f 73 68 65 | 73 20 68 61 76 65 20 76 |cintoshe|s have v|
|00003190| 69 64 65 6f 20 63 61 72 | 64 73 20 74 68 61 74 20 |ideo car|ds that |
|000031a0| 63 61 6e 20 64 69 73 70 | 6c 61 79 20 6f 6e 65 20 |can disp|lay one |
|000031b0| 70 69 78 65 6c 20 70 65 | 72 20 62 79 74 65 2c 20 |pixel pe|r byte, |
|000031c0| 73 6f 20 6f 6e 65 20 77 | 6f 75 6c 64 20 74 68 69 |so one w|ould thi|
|000031d0| 6e 6b 20 74 68 61 74 20 | 70 69 78 65 6c 20 61 6c |nk that |pixel al|
|000031e0| 69 67 6e 6d 65 6e 74 20 | 64 6f 65 73 20 6e 6f 74 |ignment |does not|
|000031f0| 20 61 70 70 6c 79 20 69 | 6e 20 74 68 65 73 65 20 | apply i|n these |
|00003200| 63 61 73 65 73 2c 20 73 | 69 6e 63 65 20 61 6c 6c |cases, s|ince all|
|00003210| 20 70 69 78 65 6c 73 20 | 61 72 65 20 61 74 20 62 | pixels |are at b|
|00003220| 79 74 65 20 62 6f 75 6e | 64 61 72 69 65 73 2e 20 |yte boun|daries. |
|00003230| 20 54 68 69 73 20 73 74 | 61 74 65 6d 65 6e 74 20 | This st|atement |
|00003240| 69 73 20 74 72 75 65 20 | 65 6e 6f 75 67 68 2c 20 |is true |enough, |
|00003250| 62 75 74 20 74 68 65 72 | 65 20 69 73 20 73 74 69 |but ther|e is sti|
|00003260| 6c 6c 20 61 6e 6f 74 68 | 65 72 20 6b 69 6e 64 20 |ll anoth|er kind |
|00003270| 6f 66 20 61 6c 69 67 6e | 6d 65 6e 74 20 74 68 61 |of align|ment tha|
|00003280| 74 20 73 68 6f 75 6c 64 | 20 62 65 20 64 6f 6e 65 |t should| be done|
|00003290| 20 6f 6e 20 74 68 65 73 | 65 20 6d 61 63 68 69 6e | on thes|e machin|
|000032a0| 65 73 2e 20 20 4d 61 63 | 69 6e 74 6f 73 68 65 73 |es. Mac|intoshes|
|000032b0| 20 77 69 74 68 20 43 6f | 6c 6f 72 20 51 75 69 63 | with Co|lor Quic|
|000032c0| 6b 44 72 61 77 20 67 65 | 6e 65 72 61 6c 6c 79 20 |kDraw ge|nerally |
|000032d0| 68 61 76 65 20 66 75 6c | 6c 20 33 32 2d 62 69 74 |have ful|l 32-bit|
|000032e0| 20 6d 69 63 72 6f 70 72 | 6f 63 65 73 73 6f 72 73 | micropr|ocessors|
|000032f0| 2c 20 61 6e 64 20 74 68 | 65 73 65 20 6d 69 63 72 |, and th|ese micr|
|00003300| 6f 70 72 6f 63 65 73 73 | 6f 72 73 20 61 72 65 20 |oprocess|ors are |
|00003310| 61 74 20 74 68 65 69 72 | 20 66 61 73 74 65 73 74 |at their| fastest|
|00003320| 20 77 68 65 6e 20 74 68 | 65 79 20 63 61 6e 20 74 | when th|ey can t|
|00003330| 72 61 6e 73 66 65 72 20 | 6c 6f 6e 67 20 77 6f 72 |ransfer |long wor|
|00003340| 64 73 20 61 6c 69 67 6e | 65 64 20 6f 6e 20 6c 6f |ds align|ed on lo|
|00003350| 6e 67 2d 77 6f 72 64 20 | 62 6f 75 6e 64 61 72 69 |ng-word |boundari|
|00003360| 65 73 20 69 6e 20 6d 65 | 6d 6f 72 79 2e 0d 4d 6f |es in me|mory..Mo|
|00003370| 64 69 66 79 69 6e 67 20 | 74 68 65 20 6c 61 73 74 |difying |the last|
|00003380| 20 65 78 61 6d 70 6c 65 | 20 73 6f 20 74 68 61 74 | example| so that|
|00003390| 20 74 68 65 20 6f 66 66 | 2d 73 63 72 65 65 6e 20 | the off|-screen |
|000033a0| 70 69 78 65 6c 20 6d 61 | 70 20 61 6e 64 20 74 68 |pixel ma|p and th|
|000033b0| 65 20 73 63 72 65 65 6e | 20 61 72 65 20 62 6f 74 |e screen| are bot|
|000033c0| 68 20 65 69 67 68 74 2d | 62 69 74 73 2d 70 65 72 |h eight-|bits-per|
|000033d0| 2d 70 69 78 65 6c 2c 20 | 74 68 65 20 70 69 78 65 |-pixel, |the pixe|
|000033e0| 6c 20 61 74 20 74 68 65 | 20 65 78 74 72 65 6d 65 |l at the| extreme|
|000033f0| 20 74 6f 70 20 6c 65 66 | 74 20 63 6f 72 6e 65 72 | top lef|t corner|
|00003400| 20 6f 66 20 74 68 65 20 | 6f 66 66 2d 73 63 72 65 | of the |off-scre|
|00003410| 65 6e 20 70 69 78 65 6c | 20 6d 61 70 20 69 73 20 |en pixel| map is |
|00003420| 6c 6f 63 61 74 65 64 20 | 61 74 20 61 20 6c 6f 6e |located |at a lon|
|00003430| 67 2d 77 6f 72 64 20 62 | 6f 75 6e 64 61 72 79 2c |g-word b|oundary,|
|00003440| 20 62 65 63 61 75 73 65 | 20 74 68 65 20 4d 61 63 | because| the Mac|
|00003450| 69 6e 74 6f 73 68 20 4d | 65 6d 6f 72 79 20 4d 61 |intosh M|emory Ma|
|00003460| 6e 61 67 65 72 20 66 6f | 72 63 65 73 20 69 74 20 |nager fo|rces it |
|00003470| 74 6f 20 62 65 20 6c 6f | 63 61 74 65 64 20 74 68 |to be lo|cated th|
|00003480| 65 72 65 3b 20 68 6f 77 | 65 76 65 72 2c 20 74 68 |ere; how|ever, th|
|00003490| 65 20 70 69 78 65 6c 20 | 61 74 20 74 68 65 20 65 |e pixel |at the e|
|000034a0| 78 74 72 65 6d 65 20 74 | 6f 70 20 6c 65 66 74 20 |xtreme t|op left |
|000034b0| 63 6f 72 6e 65 72 20 6f | 66 20 74 68 65 20 77 69 |corner o|f the wi|
|000034c0| 6e 64 6f 77 20 69 73 20 | 6c 6f 63 61 74 65 64 20 |ndow is |located |
|000034d0| 74 68 72 65 65 20 62 79 | 74 65 73 20 61 77 61 79 |three by|tes away|
|000034e0| 20 66 72 6f 6d 20 74 68 | 65 20 70 72 65 76 69 6f | from th|e previo|
|000034f0| 75 73 20 6c 6f 6e 67 2d | 77 6f 72 64 20 62 6f 75 |us long-|word bou|
|00003500| 6e 64 61 72 79 2e 20 20 | 4e 6f 20 62 69 74 20 73 |ndary. |No bit s|
|00003510| 68 69 66 74 69 6e 67 20 | 69 73 20 6e 65 65 64 65 |hifting |is neede|
|00003520| 64 2c 20 62 65 63 61 75 | 73 65 20 65 61 63 68 20 |d, becau|se each |
|00003530| 70 69 78 65 6c 20 74 61 | 6b 65 73 20 75 70 20 61 |pixel ta|kes up a|
|00003540| 20 77 68 6f 6c 65 20 62 | 79 74 65 2c 20 62 75 74 | whole b|yte, but|
|00003550| 20 5f 43 6f 70 79 42 69 | 74 73 20 64 6f 65 73 20 | _CopyBi|ts does |
|00003560| 68 61 76 65 20 74 6f 20 | 74 61 6b 65 20 74 68 65 |have to |take the|
|00003570| 20 6e 6f 6e 2d 6f 70 74 | 69 6d 75 6d 20 63 61 73 | non-opt|imum cas|
|00003580| 65 20 6f 66 20 63 6f 70 | 79 69 6e 67 20 6c 6f 6e |e of cop|ying lon|
|00003590| 67 20 77 6f 72 64 73 20 | 6f 6e 20 6e 6f 6e 2d 6c |g words |on non-l|
|000035a0| 6f 6e 67 2d 77 6f 72 64 | 20 62 6f 75 6e 64 61 72 |ong-word| boundar|
|000035b0| 69 65 73 2e 20 20 54 68 | 69 73 20 63 61 73 65 20 |ies. Th|is case |
|000035c0| 77 6f 72 6b 73 20 66 69 | 6e 65 2c 20 62 75 74 20 |works fi|ne, but |
|000035d0| 69 74 20 69 73 20 6e 6f | 74 20 71 75 69 74 65 20 |it is no|t quite |
|000035e0| 61 73 20 66 61 73 74 20 | 61 73 20 69 74 20 63 6f |as fast |as it co|
|000035f0| 75 6c 64 20 62 65 2e 20 | 20 54 6f 20 6b 65 65 70 |uld be. | To keep|
|00003600| 20 5f 43 6f 70 79 42 69 | 74 73 20 61 73 20 66 61 | _CopyBi|ts as fa|
|00003610| 73 74 20 61 73 20 70 6f | 73 73 69 62 6c 65 2c 20 |st as po|ssible, |
|00003620| 6d 61 6b 65 20 73 75 72 | 65 20 70 69 78 65 6c 73 |make sur|e pixels|
|00003630| 20 69 6e 20 74 68 65 20 | 73 6f 75 72 63 65 20 61 | in the |source a|
|00003640| 6e 64 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 20 70 |nd desti|nation p|
|00003650| 69 78 65 6c 20 6d 61 70 | 73 20 61 72 65 20 61 6c |ixel map|s are al|
|00003660| 69 67 6e 65 64 20 6f 6e | 20 6c 6f 6e 67 2d 77 6f |igned on| long-wo|
|00003670| 72 64 20 62 6f 75 6e 64 | 61 72 69 65 73 2e 0d 53 |rd bound|aries..S|
|00003680| 69 6e 63 65 20 31 39 38 | 34 2c 20 4d 61 63 69 6e |ince 198|4, Macin|
|00003690| 74 6f 73 68 20 70 72 6f | 67 72 61 6d 6d 65 72 73 |tosh pro|grammers|
|000036a0| 20 68 61 76 65 20 62 65 | 65 6e 20 74 6f 6c 64 20 | have be|en told |
|000036b0| 74 68 61 74 20 72 6f 77 | 42 79 74 65 73 20 6d 75 |that row|Bytes mu|
|000036c0| 73 74 20 62 65 20 65 76 | 65 6e 2e 20 20 54 68 61 |st be ev|en. Tha|
|000036d0| 74 20 69 73 20 73 74 69 | 6c 6c 20 74 72 75 65 2c |t is sti|ll true,|
|000036e0| 20 62 75 74 20 74 6f 20 | 61 6c 6c 6f 77 20 5f 43 | but to |allow _C|
|000036f0| 6f 70 79 42 69 74 73 20 | 74 6f 20 63 6f 70 79 20 |opyBits |to copy |
|00003700| 61 6e 20 65 6e 74 69 72 | 65 20 70 69 78 65 6c 20 |an entir|e pixel |
|00003710| 6d 61 70 20 6f 6e 20 6c | 6f 6e 67 2d 77 6f 72 64 |map on l|ong-word|
|00003720| 20 62 6f 75 6e 64 61 72 | 69 65 73 2c 20 72 6f 77 | boundar|ies, row|
|00003730| 42 79 74 65 73 20 6d 75 | 73 74 20 62 65 20 61 20 |Bytes mu|st be a |
|00003740| 6d 75 6c 74 69 70 6c 65 | 20 6f 66 20 66 6f 75 72 |multiple| of four|
|00003750| 20 73 6f 20 74 68 61 74 | 20 65 76 65 72 79 20 6c | so that| every l|
|00003760| 69 6e 65 20 69 6e 20 61 | 20 70 69 78 65 6c 20 6d |ine in a| pixel m|
|00003770| 61 70 20 62 65 67 69 6e | 73 20 6f 6e 20 61 20 6c |ap begin|s on a l|
|00003780| 6f 6e 67 2d 77 6f 72 64 | 20 62 6f 75 6e 64 61 72 |ong-word| boundar|
|00003790| 79 2e 20 20 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |y. The |followin|
|000037a0| 67 20 66 6f 72 6d 75 6c | 61 20 63 61 6e 20 62 65 |g formul|a can be|
|000037b0| 20 75 73 65 64 20 74 6f | 20 66 69 6e 64 20 74 68 | used to| find th|
|000037c0| 65 20 6d 69 6e 69 6d 75 | 6d 20 72 6f 77 42 79 74 |e minimu|m rowByt|
|000037d0| 65 73 20 6e 65 65 64 65 | 64 20 66 6f 72 20 61 20 |es neede|d for a |
|000037e0| 70 69 78 65 6c 20 6d 61 | 70 d5 73 20 62 6f 75 6e |pixel ma|p.s boun|
|000037f0| 64 73 20 72 65 63 74 61 | 6e 67 6c 65 20 77 69 74 |ds recta|ngle wit|
|00003800| 68 20 72 69 67 68 74 20 | 61 6e 64 20 6c 65 66 74 |h right |and left|
|00003810| 20 63 6f 6f 72 64 69 6e | 61 74 65 73 20 6f 66 20 | coordin|ates of |
|00003820| 62 6f 75 6e 64 73 2e 72 | 69 67 68 74 20 61 6e 64 |bounds.r|ight and|
|00003830| 20 62 6f 75 6e 64 73 2e | 6c 65 66 74 2c 20 61 6e | bounds.|left, an|
|00003840| 64 20 61 20 70 69 78 65 | 6c 20 64 65 70 74 68 20 |d a pixe|l depth |
|00003850| 6f 66 20 70 69 78 65 6c | 44 65 70 74 68 3a 0d 72 |of pixel|Depth:.r|
|00003860| 6f 77 42 79 74 65 73 20 | 3a 3d 20 28 28 70 69 78 |owBytes |:= ((pix|
|00003870| 65 6c 44 65 70 74 68 20 | 2a 20 28 62 6f 75 6e 64 |elDepth |* (bound|
|00003880| 73 2e 72 69 67 68 74 20 | 2d 20 62 6f 75 6e 64 73 |s.right |- bounds|
|00003890| 2e 6c 65 66 74 29 20 2b | 20 33 31 29 20 44 49 56 |.left) +| 31) DIV|
|000038a0| 20 33 32 29 20 2a 20 34 | 3b 0d 4f 66 66 2d 73 63 | 32) * 4|;.Off-sc|
|000038b0| 72 65 65 6e 20 47 57 6f | 72 6c 64 20 73 75 70 70 |reen GWo|rld supp|
|000038c0| 6f 72 74 2c 20 77 68 69 | 63 68 20 77 61 73 20 69 |ort, whi|ch was i|
|000038d0| 6e 74 72 6f 64 75 63 65 | 64 20 77 69 74 68 20 33 |ntroduce|d with 3|
|000038e0| 32 2d 42 69 74 20 51 75 | 69 63 6b 44 72 61 77 2c |2-Bit Qu|ickDraw,|
|000038f0| 20 63 61 6e 20 61 75 74 | 6f 6d 61 74 69 63 61 6c | can aut|omatical|
|00003900| 6c 79 20 73 65 74 20 75 | 70 20 61 20 70 69 78 65 |ly set u|p a pixe|
|00003910| 6c 20 6d 61 70 20 73 6f | 20 74 68 61 74 20 69 74 |l map so| that it|
|00003920| d5 73 20 70 72 6f 70 65 | 72 6c 79 20 61 6c 69 67 |.s prope|rly alig|
|00003930| 6e 65 64 20 74 6f 20 61 | 6e 79 20 70 61 72 74 20 |ned to a|ny part |
|00003940| 6f 66 20 74 68 65 20 64 | 65 73 74 69 6e 61 74 69 |of the d|estinati|
|00003950| 6f 6e 20 70 69 78 65 6c | 20 6d 61 70 20 6f 72 20 |on pixel| map or |
|00003960| 62 69 74 20 6d 61 70 2e | 20 20 59 6f 75 20 63 61 |bit map.| You ca|
|00003970| 6e 20 73 70 65 63 69 66 | 79 20 74 68 61 74 20 79 |n specif|y that y|
|00003980| 6f 75 20 77 61 6e 74 20 | 74 68 69 73 20 62 79 20 |ou want |this by |
|00003990| 70 61 73 73 69 6e 67 20 | 7a 65 72 6f 20 66 6f 72 |passing |zero for|
|000039a0| 20 74 68 65 20 70 69 78 | 65 6c 20 64 65 70 74 68 | the pix|el depth|
|000039b0| 20 61 6e 64 20 70 61 73 | 73 69 6e 67 20 74 68 65 | and pas|sing the|
|000039c0| 20 72 65 63 74 61 6e 67 | 6c 65 20 6f 66 20 74 68 | rectang|le of th|
|000039d0| 65 20 64 65 73 74 69 6e | 61 74 69 6f 6e 20 61 72 |e destin|ation ar|
|000039e0| 65 61 20 69 6e 20 67 6c | 6f 62 61 6c 20 63 6f 6f |ea in gl|obal coo|
|000039f0| 72 64 69 6e 61 74 65 73 | 2e 20 20 53 65 65 20 74 |rdinates|. See t|
|00003a00| 68 65 20 33 32 2d 42 69 | 74 20 51 75 69 63 6b 44 |he 32-Bi|t QuickD|
|00003a10| 72 61 77 20 44 65 76 65 | 6c 6f 70 65 72 73 d5 20 |raw Deve|lopers. |
|00003a20| 4e 6f 74 65 73 20 61 6e | 64 20 d2 42 72 61 76 69 |Notes an|d .Bravi|
|00003a30| 6e 67 20 4f 66 66 73 63 | 72 65 65 6e 20 57 6f 72 |ng Offsc|reen Wor|
|00003a40| 6c 64 73 d3 20 69 6e 20 | 64 ca 65 ca 76 ca 65 ca |lds. in |d.e.v.e.|
|00003a50| 6c ca 6f ca 70 2c 20 4a | 61 6e 75 61 72 79 20 31 |l.o.p, J|anuary 1|
|00003a60| 39 39 30 20 66 6f 72 20 | 64 65 74 61 69 6c 73 2e |990 for |details.|
|00003a70| 0d 54 68 65 20 77 61 79 | 20 74 68 61 74 20 5f 4e |.The way| that _N|
|00003a80| 65 77 47 57 6f 72 6c 64 | 20 61 6c 69 67 6e 73 20 |ewGWorld| aligns |
|00003a90| 61 20 47 57 6f 72 6c 64 | 20 69 73 20 74 6f 20 73 |a GWorld| is to s|
|00003aa0| 65 74 20 75 70 20 74 68 | 65 20 6f 66 66 2d 73 63 |et up th|e off-sc|
|00003ab0| 72 65 65 6e 20 70 69 78 | 65 6c 20 6d 61 70 20 73 |reen pix|el map s|
|00003ac0| 6f 20 74 68 61 74 20 69 | 74 73 20 72 6f 77 42 79 |o that i|ts rowBy|
|00003ad0| 74 65 73 20 69 73 20 66 | 6f 75 72 20 62 79 74 65 |tes is f|our byte|
|00003ae0| 73 20 77 69 64 65 72 20 | 74 68 61 6e 20 6f 6e 65 |s wider |than one|
|00003af0| 20 77 6f 75 6c 64 20 6e | 6f 72 6d 61 6c 6c 79 20 | would n|ormally |
|00003b00| 63 61 6c 63 75 6c 61 74 | 65 2e 20 20 46 6f 75 72 |calculat|e. Four|
|00003b10| 20 62 79 74 65 73 20 69 | 73 20 74 68 65 20 6d 61 | bytes i|s the ma|
|00003b20| 78 69 6d 75 6d 20 61 6d | 6f 75 6e 74 20 74 68 61 |ximum am|ount tha|
|00003b30| 74 20 61 6e 79 20 70 69 | 78 65 6c 20 6d 61 70 20 |t any pi|xel map |
|00003b40| 77 6f 75 6c 64 20 68 61 | 76 65 20 74 6f 20 62 65 |would ha|ve to be|
|00003b50| 20 72 65 61 6c 69 67 6e | 65 64 20 61 74 20 61 6e | realign|ed at an|
|00003b60| 79 20 70 69 78 65 6c 20 | 64 65 70 74 68 2e 20 20 |y pixel |depth. |
|00003b70| 54 68 65 20 62 6f 75 6e | 64 73 20 72 65 63 74 61 |The boun|ds recta|
|00003b80| 6e 67 6c 65 d5 73 20 6c | 65 66 74 20 63 6f 6f 72 |ngle.s l|eft coor|
|00003b90| 64 69 6e 61 74 65 20 69 | 73 20 73 65 74 20 74 6f |dinate i|s set to|
|00003ba0| 20 74 68 65 20 6e 65 67 | 61 74 69 76 65 20 6f 66 | the neg|ative of|
|00003bb0| 20 74 68 65 20 6c 65 66 | 74 20 63 6f 6f 72 64 69 | the lef|t coordi|
|00003bc0| 6e 61 74 65 20 6f 66 20 | 74 68 65 20 64 65 73 74 |nate of |the dest|
|00003bd0| 69 6e 61 74 69 6f 6e 20 | 72 65 63 74 61 6e 67 6c |ination |rectangl|
|00003be0| 65 20 69 6e 20 67 6c 6f | 62 61 6c 20 63 6f 6f 72 |e in glo|bal coor|
|00003bf0| 64 69 6e 61 74 65 73 20 | 6d 6f 64 75 6c 6f 20 28 |dinates |modulo (|
|00003c00| 33 32 20 2f 20 70 69 78 | 65 6c 20 64 65 70 74 68 |32 / pix|el depth|
|00003c10| 29 2c 20 62 65 63 61 75 | 73 65 20 74 68 69 73 20 |), becau|se this |
|00003c20| 69 73 20 6d 61 78 69 6d | 75 6d 20 61 6d 6f 75 6e |is maxim|um amoun|
|00003c30| 74 20 74 68 61 74 20 61 | 20 70 69 78 65 6c 20 6d |t that a| pixel m|
|00003c40| 61 70 20 6d 75 73 74 20 | 62 65 20 73 68 69 66 74 |ap must |be shift|
|00003c50| 65 64 20 74 6f 20 61 63 | 68 69 65 76 65 20 70 65 |ed to ac|hieve pe|
|00003c60| 72 66 65 63 74 20 61 6c | 69 67 6e 6d 65 6e 74 2e |rfect al|ignment.|
|00003c70| 20 20 54 6f 20 62 75 69 | 6c 64 20 6f 6e 20 74 68 | To bui|ld on th|
|00003c80| 65 20 65 61 72 6c 69 65 | 72 20 65 78 61 6d 70 6c |e earlie|r exampl|
|00003c90| 65 2c 20 61 73 73 75 6d | 65 20 79 6f 75 20 68 61 |e, assum|e you ha|
|00003ca0| 76 65 20 61 20 31 32 38 | 2d 70 69 78 65 6c 20 77 |ve a 128|-pixel w|
|00003cb0| 69 64 65 2c 20 65 69 67 | 68 74 2d 62 69 74 20 64 |ide, eig|ht-bit d|
|00003cc0| 65 65 70 2c 20 6f 66 66 | 2d 73 63 72 65 65 6e 20 |eep, off|-screen |
|00003cd0| 70 69 78 65 6c 20 6d 61 | 70 20 74 6f 20 63 6f 70 |pixel ma|p to cop|
|00003ce0| 79 20 74 6f 20 61 20 77 | 69 6e 64 6f 77 20 74 68 |y to a w|indow th|
|00003cf0| 61 74 20 69 73 20 74 68 | 72 65 65 20 70 69 78 65 |at is th|ree pixe|
|00003d00| 6c 73 20 61 77 61 79 20 | 66 72 6f 6d 20 74 68 65 |ls away |from the|
|00003d10| 20 6c 65 66 74 20 65 64 | 67 65 20 6f 66 20 61 6e | left ed|ge of an|
|00003d20| 20 65 69 67 68 74 2d 62 | 69 74 20 63 6f 6c 6f 72 | eight-b|it color|
|00003d30| 20 73 63 72 65 65 6e 2e | 0d 46 69 72 73 74 2c 20 | screen.|.First, |
|00003d40| 74 68 65 20 72 6f 77 42 | 79 74 65 73 20 66 6f 72 |the rowB|ytes for|
|00003d50| 20 74 68 65 20 6f 66 66 | 2d 73 63 72 65 65 6e 20 | the off|-screen |
|00003d60| 70 69 78 65 6c 20 6d 61 | 70 20 69 73 20 73 65 74 |pixel ma|p is set|
|00003d70| 20 74 6f 20 31 33 31 20 | 74 6f 20 61 6c 6c 6f 77 | to 131 |to allow|
|00003d80| 20 72 6f 6f 6d 20 66 6f | 72 20 72 65 61 6c 69 67 | room fo|r realig|
|00003d90| 6e 6d 65 6e 74 2e 20 20 | 54 6f 20 61 6c 69 67 6e |nment. |To align|
|00003da0| 20 74 68 65 20 6f 66 66 | 2d 73 63 72 65 65 6e 20 | the off|-screen |
|00003db0| 70 69 78 65 6c 20 6d 61 | 70 20 74 6f 20 74 68 65 |pixel ma|p to the|
|00003dc0| 20 6f 6e 2d 73 63 72 65 | 65 6e 20 77 69 6e 64 6f | on-scre|en windo|
|00003dd0| 77 2c 20 74 68 65 20 6c | 65 66 74 20 63 6f 6f 72 |w, the l|eft coor|
|00003de0| 64 69 6e 61 74 65 20 6f | 66 20 74 68 65 20 6f 66 |dinate o|f the of|
|00003df0| 66 2d 73 63 72 65 65 6e | 20 62 69 74 20 6d 61 70 |f-screen| bit map|
|00003e00| d5 73 20 62 6f 75 6e 64 | 73 20 69 73 20 73 65 74 |.s bound|s is set|
|00003e10| 20 74 6f 20 2d 33 20 61 | 6e 64 20 74 68 65 20 72 | to -3 a|nd the r|
|00003e20| 69 67 68 74 20 63 6f 6f | 72 64 69 6e 61 74 65 20 |ight coo|rdinate |
|00003e30| 69 73 20 73 74 69 6c 6c | 20 61 74 20 31 32 38 2e |is still| at 128.|
|00003e40| 20 20 4e 6f 74 69 63 65 | 20 74 68 61 74 20 74 68 | Notice| that th|
|00003e50| 65 20 6f 66 66 2d 73 63 | 72 65 65 6e 20 70 69 78 |e off-sc|reen pix|
|00003e60| 65 6c 20 6d 61 70 d5 73 | 20 62 6f 75 6e 64 73 20 |el map.s| bounds |
|00003e70| 69 73 20 6e 6f 77 20 31 | 33 31 20 70 69 78 65 6c |is now 1|31 pixel|
|00003e80| 73 20 77 69 64 65 2e 20 | 20 4e 6f 77 2c 20 74 68 |s wide. | Now, th|
|00003e90| 65 20 70 69 78 65 6c 73 | 20 69 6e 20 74 68 65 20 |e pixels| in the |
|00003ea0| 6f 66 66 2d 73 63 72 65 | 65 6e 20 70 69 78 65 6c |off-scre|en pixel|
|00003eb0| 20 6d 61 70 20 77 69 74 | 68 20 61 20 68 6f 72 69 | map wit|h a hori|
|00003ec0| 7a 6f 6e 74 61 6c 20 63 | 6f 6f 72 64 69 6e 61 74 |zontal c|oordinat|
|00003ed0| 65 20 6f 66 20 30 20 61 | 72 65 20 6c 6f 63 61 74 |e of 0 a|re locat|
|00003ee0| 65 64 20 74 68 72 65 65 | 20 62 79 74 65 73 20 61 |ed three| bytes a|
|00003ef0| 77 61 79 20 66 72 6f 6d | 20 74 68 65 20 70 72 65 |way from| the pre|
|00003f00| 76 69 6f 75 73 20 6c 6f | 6e 67 2d 77 6f 72 64 20 |vious lo|ng-word |
|00003f10| 62 6f 75 6e 64 61 72 79 | 2e 20 20 54 68 65 20 70 |boundary|. The p|
|00003f20| 69 78 65 6c 73 20 6f 6e | 20 74 68 65 20 6c 65 66 |ixels on| the lef|
|00003f30| 74 20 65 64 67 65 20 6f | 66 20 74 68 65 20 77 69 |t edge o|f the wi|
|00003f40| 6e 64 6f 77 20 61 72 65 | 20 61 6c 73 6f 20 6c 6f |ndow are| also lo|
|00003f50| 63 61 74 65 64 20 74 68 | 72 65 65 20 62 79 74 65 |cated th|ree byte|
|00003f60| 73 20 61 77 61 79 20 66 | 72 6f 6d 20 74 68 65 20 |s away f|rom the |
|00003f70| 70 72 65 76 69 6f 75 73 | 20 6c 6f 6e 67 2d 77 6f |previous| long-wo|
|00003f80| 72 64 20 62 6f 75 6e 64 | 61 72 79 2c 20 73 6f 20 |rd bound|ary, so |
|00003f90| 5f 43 6f 70 79 42 69 74 | 73 20 63 61 6e 20 63 6f |_CopyBit|s can co|
|00003fa0| 70 79 20 6c 6f 6e 67 20 | 77 6f 72 64 73 20 6f 6e |py long |words on|
|00003fb0| 20 6c 6f 6e 67 2d 77 6f | 72 64 20 62 6f 75 6e 64 | long-wo|rd bound|
|00003fc0| 61 72 69 65 73 2e 0d 49 | 66 20 61 20 75 73 65 72 |aries..I|f a user|
|00003fd0| 20 6d 6f 76 65 73 20 74 | 68 65 20 77 69 6e 64 6f | moves t|he windo|
|00003fe0| 77 20 73 6f 20 74 68 61 | 74 20 69 74 d5 73 20 74 |w so tha|t it.s t|
|00003ff0| 77 6f 20 70 69 78 65 6c | 73 20 66 72 6f 6d 20 74 |wo pixel|s from t|
|00004000| 68 65 20 6c 65 66 74 20 | 65 64 67 65 20 6f 66 20 |he left |edge of |
|00004010| 74 68 65 20 73 63 72 65 | 65 6e 2c 20 74 68 65 20 |the scre|en, the |
|00004020| 6f 66 66 2d 73 63 72 65 | 65 6e 20 70 69 78 65 6c |off-scre|en pixel|
|00004030| 20 6d 61 70 20 6d 75 73 | 74 20 62 65 20 72 65 61 | map mus|t be rea|
|00004040| 6c 69 67 6e 65 64 2e 20 | 20 5f 55 70 64 61 74 65 |ligned. | _Update|
|00004050| 47 57 6f 72 6c 64 20 69 | 73 20 75 73 65 64 20 74 |GWorld i|s used t|
|00004060| 6f 20 64 6f 20 74 68 69 | 73 2e 20 20 49 74 20 63 |o do thi|s. It c|
|00004070| 68 61 6e 67 65 73 20 74 | 68 65 20 6c 65 66 74 20 |hanges t|he left |
|00004080| 63 6f 6f 72 64 69 6e 61 | 74 65 20 6f 66 20 74 68 |coordina|te of th|
|00004090| 65 20 6f 66 66 2d 73 63 | 72 65 65 6e 20 70 69 78 |e off-sc|reen pix|
|000040a0| 65 6c 20 6d 61 70 d5 73 | 20 62 6f 75 6e 64 73 20 |el map.s| bounds |
|000040b0| 72 65 63 74 61 6e 67 6c | 65 20 74 6f 20 2d 32 20 |rectangl|e to -2 |
|000040c0| 61 6e 64 20 74 68 65 6e | 20 69 74 20 73 68 69 66 |and then| it shif|
|000040d0| 74 73 20 61 6c 6c 20 74 | 68 65 20 70 69 78 65 6c |ts all t|he pixel|
|000040e0| 73 20 69 6e 20 74 68 65 | 20 6f 66 66 2d 73 63 72 |s in the| off-scr|
|000040f0| 65 65 6e 20 70 69 78 65 | 6c 20 6d 61 70 20 6f 6e |een pixe|l map on|
|00004100| 65 20 70 69 78 65 6c 20 | 74 6f 20 74 68 65 20 6c |e pixel |to the l|
|00004110| 65 66 74 2e 20 20 54 68 | 65 20 65 78 74 72 61 20 |eft. Th|e extra |
|00004120| 66 6f 75 72 20 62 79 74 | 65 73 20 69 6e 20 65 61 |four byt|es in ea|
|00004130| 63 68 20 72 6f 77 20 70 | 72 6f 76 69 64 65 20 74 |ch row p|rovide t|
|00004140| 68 65 20 72 6f 6f 6d 20 | 66 6f 72 20 74 68 69 73 |he room |for this|
|00004150| 20 73 68 69 66 74 69 6e | 67 2e 20 20 28 47 69 76 | shiftin|g. (Giv|
|00004160| 65 73 20 79 6f 75 20 73 | 6f 6d 65 20 6e 65 77 20 |es you s|ome new |
|00004170| 72 65 73 70 65 63 74 20 | 66 6f 72 20 74 68 65 20 |respect |for the |
|00004180| 6f 66 66 2d 73 63 72 65 | 65 6e 20 73 75 70 70 6f |off-scre|en suppo|
|00004190| 72 74 2c 20 64 6f 65 73 | 6e d5 74 20 69 74 3f 29 |rt, does|n.t it?)|
|000041a0| 0d 54 68 69 73 20 73 61 | 6d 65 20 64 69 73 63 75 |.This sa|me discu|
|000041b0| 73 73 69 6f 6e 20 61 70 | 70 6c 69 65 73 20 74 6f |ssion ap|plies to|
|000041c0| 20 61 6e 79 20 70 69 78 | 65 6c 20 64 65 70 74 68 | any pix|el depth|
|000041d0| 2c 20 74 68 6f 75 67 68 | 20 73 68 61 6c 6c 6f 77 |, though| shallow|
|000041e0| 65 72 20 70 69 78 65 6c | 20 64 65 70 74 68 73 20 |er pixel| depths |
|000041f0| 72 65 71 75 69 72 65 20 | 62 69 74 20 73 68 69 66 |require |bit shif|
|00004200| 74 69 6e 67 20 72 61 74 | 68 65 72 20 74 68 61 6e |ting rat|her than|
|00004210| 20 62 79 74 65 20 73 68 | 69 66 74 69 6e 67 2e 20 | byte sh|ifting. |
|00004220| 20 54 68 65 20 73 61 6d | 65 20 70 72 69 6e 63 69 | The sam|e princi|
|00004230| 70 6c 65 73 20 61 70 70 | 6c 79 2c 20 74 68 6f 75 |ples app|ly, thou|
|00004240| 67 68 2e 20 20 4e 6f 74 | 69 63 65 20 74 68 61 74 |gh. Not|ice that|
|00004250| 20 69 6e 20 61 20 33 32 | 2d 62 69 74 20 64 65 65 | in a 32|-bit dee|
|00004260| 70 20 70 69 78 65 6c 20 | 6d 61 70 2c 20 61 6c 6c |p pixel |map, all|
|00004270| 20 70 69 78 65 6c 73 20 | 61 72 65 20 61 6c 69 67 | pixels |are alig|
|00004280| 6e 65 64 20 6f 6e 20 6c | 6f 6e 67 2d 77 6f 72 64 |ned on l|ong-word|
|00004290| 20 62 6f 75 6e 64 61 72 | 69 65 73 2c 20 73 6f 20 | boundar|ies, so |
|000042a0| 6e 6f 20 62 69 74 20 73 | 68 69 66 74 69 6e 67 20 |no bit s|hifting |
|000042b0| 6f 72 20 62 79 74 65 20 | 73 68 69 66 74 69 6e 67 |or byte |shifting|
|000042c0| 20 65 76 65 72 20 6e 65 | 65 64 73 20 74 6f 20 62 | ever ne|eds to b|
|000042d0| 65 20 64 6f 6e 65 20 6f | 6e 20 6f 6e 65 20 6f 66 |e done o|n one of|
|000042e0| 20 74 68 6f 73 65 2e 20 | 20 5f 4e 65 77 47 57 6f | those. | _NewGWo|
|000042f0| 72 6c 64 20 73 74 69 6c | 6c 20 61 64 64 73 20 66 |rld stil|l adds f|
|00004300| 6f 75 72 20 74 6f 20 72 | 6f 77 42 79 74 65 73 20 |our to r|owBytes |
|00004310| 65 76 65 6e 20 69 6e 20 | 74 68 69 73 20 63 61 73 |even in |this cas|
|00004320| 65 2c 20 68 6f 77 65 76 | 65 72 2e 0d 4d 6f 64 69 |e, howev|er..Modi|
|00004330| 66 79 69 6e 67 20 74 68 | 65 20 73 74 61 6e 64 61 |fying th|e standa|
|00004340| 72 64 20 74 65 73 74 20 | 73 6f 20 74 68 61 74 20 |rd test |so that |
|00004350| 74 68 65 20 73 6f 75 72 | 63 65 20 61 6e 64 20 64 |the sour|ce and d|
|00004360| 65 73 74 69 6e 61 74 69 | 6f 6e 20 70 69 78 65 6c |estinati|on pixel|
|00004370| 20 6d 61 70 73 20 61 72 | 65 20 66 6f 75 72 20 62 | maps ar|e four b|
|00004380| 69 74 73 20 64 65 65 70 | 20 77 69 74 68 20 70 65 |its deep| with pe|
|00004390| 72 66 65 63 74 20 70 69 | 78 65 6c 20 61 6c 69 67 |rfect pi|xel alig|
|000043a0| 6e 6d 65 6e 74 20 70 72 | 6f 64 75 63 65 73 20 61 |nment pr|oduces a|
|000043b0| 20 72 65 73 75 6c 74 20 | 6f 66 20 37 38 20 74 69 | result |of 78 ti|
|000043c0| 63 6b 73 3b 20 68 6f 77 | 65 76 65 72 2c 20 69 66 |cks; how|ever, if|
|000043d0| 20 74 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | the des|tination|
|000043e0| 20 70 69 78 65 6c 20 6d | 61 70 20 69 73 20 6f 6e | pixel m|ap is on|
|000043f0| 65 20 70 69 78 65 6c 20 | 6c 65 66 74 20 6f 66 20 |e pixel |left of |
|00004400| 70 65 72 66 65 63 74 20 | 61 6c 69 67 6e 6d 65 6e |perfect |alignmen|
|00004410| 74 2c 20 74 68 65 20 72 | 65 73 75 6c 74 20 69 73 |t, the r|esult is|
|00004420| 20 32 32 38 20 74 69 63 | 6b 73 2e 0d 53 70 65 65 | 228 tic|ks..Spee|
|00004430| 64 20 6f 66 20 74 68 65 | 20 48 61 72 64 77 61 72 |d of the| Hardwar|
|00004440| 65 2c 20 4f 66 20 43 6f | 75 72 73 65 0d 4f 62 76 |e, Of Co|urse.Obv|
|00004450| 69 6f 75 73 6c 79 2c 20 | 74 68 65 20 73 70 65 65 |iously, |the spee|
|00004460| 64 20 6f 66 20 74 68 65 | 20 6d 61 63 68 69 6e 65 |d of the| machine|
|00004470| 20 79 6f 75 72 20 61 70 | 70 6c 69 63 61 74 69 6f | your ap|plicatio|
|00004480| 6e 20 69 73 20 72 75 6e | 6e 69 6e 67 20 6f 6e 20 |n is run|ning on |
|00004490| 61 66 66 65 63 74 73 20 | 74 68 65 20 73 70 65 65 |affects |the spee|
|000044a0| 64 20 6f 66 20 5f 43 6f | 70 79 42 69 74 73 2e 20 |d of _Co|pyBits. |
|000044b0| 20 54 6f 20 6d 61 6b 65 | 20 5f 43 6f 70 79 42 69 | To make| _CopyBi|
|000044c0| 74 73 20 61 73 20 66 61 | 73 74 20 61 73 20 70 6f |ts as fa|st as po|
|000044d0| 73 73 69 62 6c 65 2c 20 | 73 70 65 6e 64 20 61 20 |ssible, |spend a |
|000044e0| 6c 6f 74 20 6f 66 20 6d | 6f 6e 65 79 2e 20 20 48 |lot of m|oney. H|
|000044f0| 6f 77 65 76 65 72 2c 20 | 74 68 65 72 65 20 69 73 |owever, |there is|
|00004500| 20 6d 6f 72 65 20 74 6f | 20 74 68 65 20 73 70 65 | more to| the spe|
|00004510| 65 64 20 6f 66 20 5f 43 | 6f 70 79 42 69 74 73 20 |ed of _C|opyBits |
|00004520| 74 68 61 6e 20 74 68 65 | 20 73 70 65 65 64 20 6f |than the| speed o|
|00004530| 66 20 74 68 65 20 4d 61 | 63 69 6e 74 6f 73 68 20 |f the Ma|cintosh |
|00004540| 69 74 73 65 6c 66 2e 20 | 20 57 68 65 6e 20 74 68 |itself. | When th|
|00004550| 65 20 4d 61 63 69 6e 74 | 6f 73 68 20 31 32 38 4b |e Macint|osh 128K|
|00004560| 20 77 61 73 20 72 65 6c | 65 61 73 65 64 2c 20 74 | was rel|eased, t|
|00004570| 68 65 72 65 20 77 61 73 | 20 6f 6e 6c 79 20 6f 6e |here was| only on|
|00004580| 65 20 70 6c 61 63 65 20 | 66 6f 72 20 70 69 78 65 |e place |for pixe|
|00004590| 6c 20 69 6d 61 67 65 73 | 3a 20 6d 61 69 6e 20 6d |l images|: main m|
|000045a0| 65 6d 6f 72 79 2e 20 20 | 54 6f 64 61 79 2c 20 74 |emory. |Today, t|
|000045b0| 68 65 20 73 69 74 75 61 | 74 69 6f 6e 20 69 73 20 |he situa|tion is |
|000045c0| 6d 6f 72 65 20 63 6f 6d | 70 6c 69 63 61 74 65 64 |more com|plicated|
|000045d0| 2e 20 20 49 66 20 79 6f | 75 20 68 61 76 65 20 61 |. If yo|u have a|
|000045e0| 20 6d 6f 64 75 6c 61 72 | 20 4d 61 63 69 6e 74 6f | modular| Macinto|
|000045f0| 73 68 2c 20 74 68 65 20 | 70 69 78 65 6c 20 69 6d |sh, the |pixel im|
|00004600| 61 67 65 20 66 6f 72 20 | 74 68 65 20 73 63 72 65 |age for |the scre|
|00004610| 65 6e 20 69 73 20 69 6e | 20 74 68 65 20 6d 65 6d |en is in| the mem|
|00004620| 6f 72 79 20 6f 66 20 61 | 20 4e 75 42 75 73 aa 20 |ory of a| NuBus. |
|00004630| 76 69 64 65 6f 20 63 61 | 72 64 2e 20 20 49 66 20 |video ca|rd. If |
|00004640| 79 6f 75 20 68 61 76 65 | 20 61 20 4d 61 63 69 6e |you have| a Macin|
|00004650| 74 6f 73 68 20 49 49 63 | 69 2c 20 79 6f 75 20 63 |tosh IIc|i, you c|
|00004660| 61 6e 20 6f 70 74 69 6f | 6e 61 6c 6c 79 20 61 62 |an optio|nally ab|
|00004670| 61 6e 64 6f 6e 20 74 68 | 65 20 4e 75 42 75 73 20 |andon th|e NuBus |
|00004680| 76 69 64 65 6f 20 63 61 | 72 64 20 61 6e 64 20 75 |video ca|rd and u|
|00004690| 73 65 20 6f 6e 2d 62 6f | 61 72 64 20 76 69 64 65 |se on-bo|ard vide|
|000046a0| 6f 20 77 68 69 63 68 20 | 74 61 6b 65 73 20 75 70 |o which |takes up|
|000046b0| 20 70 61 72 74 20 6f 66 | 20 6d 61 69 6e 20 6d 65 | part of| main me|
|000046c0| 6d 6f 72 79 2e 20 20 49 | 66 20 79 6f 75 20 68 61 |mory. I|f you ha|
|000046d0| 76 65 20 61 6e 20 38 a5 | 32 34 20 47 43 20 63 61 |ve an 8.|24 GC ca|
|000046e0| 72 64 20 77 69 74 68 20 | 65 6e 6f 75 67 68 20 6d |rd with |enough m|
|000046f0| 65 6d 6f 72 79 2c 20 74 | 68 65 20 70 69 78 65 6c |emory, t|he pixel|
|00004700| 20 69 6d 61 67 65 73 20 | 63 61 6e 20 62 65 20 63 | images |can be c|
|00004710| 61 63 68 65 64 20 69 6e | 20 74 68 65 20 63 61 72 |ached in| the car|
|00004720| 64 d5 73 20 6d 65 6d 6f | 72 79 20 61 6c 6f 6e 67 |d.s memo|ry along|
|00004730| 20 77 69 74 68 20 74 68 | 65 20 73 63 72 65 65 6e | with th|e screen|
|00004740| d5 73 20 70 69 78 65 6c | 20 69 6d 61 67 65 2e 0d |.s pixel| image..|
|00004750| 41 6c 6c 20 6f 66 20 74 | 68 65 73 65 20 64 69 66 |All of t|hese dif|
|00004760| 66 65 72 65 6e 74 20 6c | 6f 63 61 74 69 6f 6e 73 |ferent l|ocations|
|00004770| 20 68 61 76 65 20 64 69 | 66 66 65 72 65 6e 74 20 | have di|fferent |
|00004780| 61 63 63 65 73 73 20 73 | 70 65 65 64 73 2c 20 61 |access s|peeds, a|
|00004790| 6e 64 20 74 68 61 74 20 | 63 61 6e 20 61 66 66 65 |nd that |can affe|
|000047a0| 63 74 20 74 68 65 20 73 | 70 65 65 64 20 6f 66 20 |ct the s|peed of |
|000047b0| 5f 43 6f 70 79 42 69 74 | 73 2e 20 20 41 64 64 69 |_CopyBit|s. Addi|
|000047c0| 74 69 6f 6e 61 6c 6c 79 | 2c 20 64 69 66 66 65 72 |tionally|, differ|
|000047d0| 65 6e 74 20 4d 61 63 69 | 6e 74 6f 73 68 65 73 20 |ent Maci|ntoshes |
|000047e0| 68 61 76 65 20 64 69 66 | 66 65 72 65 6e 74 20 52 |have dif|ferent R|
|000047f0| 41 4d 20 61 63 63 65 73 | 73 20 73 70 65 65 64 73 |AM acces|s speeds|
|00004800| 2e 20 20 54 68 65 20 4d | 61 63 69 6e 74 6f 73 68 |. The M|acintosh|
|00004810| 20 49 49 2c 20 49 49 78 | 2c 20 49 49 63 78 2c 20 | II, IIx|, IIcx, |
|00004820| 61 6e 64 20 53 45 2f 33 | 30 20 68 61 76 65 20 66 |and SE/3|0 have f|
|00004830| 61 73 74 65 72 20 52 41 | 4d 20 74 68 61 6e 20 74 |aster RA|M than t|
|00004840| 68 65 20 4d 61 63 69 6e | 74 6f 73 68 20 50 6c 75 |he Macin|tosh Plu|
|00004850| 73 20 6f 72 20 53 45 2e | 20 20 54 68 65 20 4d 61 |s or SE.| The Ma|
|00004860| 63 69 6e 74 6f 73 68 20 | 49 49 63 69 20 52 41 4d |cintosh |IIci RAM|
|00004870| 20 61 63 63 65 73 73 20 | 73 70 65 65 64 20 69 73 | access |speed is|
|00004880| 20 66 61 73 74 65 72 20 | 73 74 69 6c 6c 2c 20 61 | faster |still, a|
|00004890| 6e 64 20 74 68 65 20 4d | 61 63 69 6e 74 6f 73 68 |nd the M|acintosh|
|000048a0| 20 49 49 66 78 20 68 61 | 73 20 66 61 73 74 65 72 | IIfx ha|s faster|
|000048b0| 20 52 41 4d 20 61 63 63 | 65 73 73 20 74 68 61 6e | RAM acc|ess than|
|000048c0| 20 74 68 65 20 49 49 63 | 69 2e 20 20 44 69 66 66 | the IIc|i. Diff|
|000048d0| 65 72 65 6e 74 20 76 69 | 64 65 6f 20 63 61 72 64 |erent vi|deo card|
|000048e0| 73 20 68 61 76 65 20 64 | 69 66 66 65 72 65 6e 74 |s have d|ifferent|
|000048f0| 20 61 63 63 65 73 73 20 | 73 70 65 65 64 73 2e 20 | access |speeds. |
|00004900| 20 54 68 65 20 49 49 63 | 69 20 68 61 73 20 61 20 | The IIc|i has a |
|00004910| 63 61 63 68 65 20 63 61 | 72 64 20 6f 70 74 69 6f |cache ca|rd optio|
|00004920| 6e 20 77 68 69 63 68 20 | 63 61 6e 20 76 61 73 74 |n which |can vast|
|00004930| 6c 79 20 73 70 65 65 64 | 20 75 70 20 6f 6e 2d 62 |ly speed| up on-b|
|00004940| 6f 61 72 64 20 76 69 64 | 65 6f 20 52 41 4d 20 61 |oard vid|eo RAM a|
|00004950| 63 63 65 73 73 20 73 70 | 65 65 64 2e 20 20 54 68 |ccess sp|eed. Th|
|00004960| 69 72 64 2d 70 61 72 74 | 79 20 76 69 64 65 6f 20 |ird-part|y video |
|00004970| 63 61 72 64 73 20 74 68 | 61 74 20 77 6f 72 6b 20 |cards th|at work |
|00004980| 69 6e 20 74 68 65 20 50 | 72 6f 63 65 73 73 6f 72 |in the P|rocessor|
|00004990| 20 44 69 72 65 63 74 20 | 53 6c 6f 74 20 6f 66 20 | Direct |Slot of |
|000049a0| 74 68 65 20 4d 61 63 69 | 6e 74 6f 73 68 20 53 45 |the Maci|ntosh SE|
|000049b0| 20 61 6e 64 20 53 45 2f | 33 30 20 68 61 76 65 20 | and SE/|30 have |
|000049c0| 74 68 65 69 72 20 6f 77 | 6e 20 73 70 65 65 64 20 |their ow|n speed |
|000049d0| 63 68 61 72 61 63 74 65 | 72 69 73 74 69 63 73 20 |characte|ristics |
|000049e0| 61 73 20 77 65 6c 6c 2e | 0d 54 68 65 72 65 20 63 |as well.|.There c|
|000049f0| 61 6e 20 61 6c 73 6f 20 | 62 65 20 61 20 73 70 65 |an also |be a spe|
|00004a00| 65 64 20 63 6f 73 74 20 | 66 6f 72 20 63 72 6f 73 |ed cost |for cros|
|00004a10| 73 69 6e 67 20 74 68 65 | 20 64 69 66 66 65 72 65 |sing the| differe|
|00004a20| 6e 74 20 61 72 65 61 73 | 2e 20 20 49 66 20 5f 43 |nt areas|. If _C|
|00004a30| 6f 70 79 42 69 74 73 20 | 63 6f 70 69 65 73 20 62 |opyBits |copies b|
|00004a40| 65 74 77 65 65 6e 20 6d | 61 69 6e 20 6d 65 6d 6f |etween m|ain memo|
|00004a50| 72 79 20 61 6e 64 20 61 | 20 4e 75 42 75 73 20 76 |ry and a| NuBus v|
|00004a60| 69 64 65 6f 20 63 61 72 | 64 2c 20 74 68 65 20 69 |ideo car|d, the i|
|00004a70| 6d 61 67 65 20 64 61 74 | 61 20 68 61 73 20 74 6f |mage dat|a has to|
|00004a80| 20 62 65 20 74 72 61 6e | 73 66 65 72 72 65 64 20 | be tran|sferred |
|00004a90| 61 63 72 6f 73 73 20 4e | 75 42 75 73 2e 20 20 4e |across N|uBus. N|
|00004aa0| 75 42 75 73 20 69 73 20 | 61 20 73 70 65 65 64 20 |uBus is |a speed |
|00004ab0| 62 6f 74 74 6c 65 6e 65 | 63 6b 2c 20 73 6f 20 63 |bottlene|ck, so c|
|00004ac0| 6f 70 79 69 6e 67 20 61 | 6e 20 69 6d 61 67 65 20 |opying a|n image |
|00004ad0| 61 63 72 6f 73 73 20 4e | 75 42 75 73 20 69 73 20 |across N|uBus is |
|00004ae0| 73 6c 6f 77 65 72 20 74 | 68 61 6e 20 63 6f 70 79 |slower t|han copy|
|00004af0| 69 6e 67 20 74 68 65 20 | 69 6d 61 67 65 20 66 72 |ing the |image fr|
|00004b00| 6f 6d 20 6f 6e 65 20 70 | 61 72 74 20 6f 66 20 74 |om one p|art of t|
|00004b10| 68 65 20 73 63 72 65 65 | 6e 20 74 6f 20 61 6e 6f |he scree|n to ano|
|00004b20| 74 68 65 72 20 6f 72 20 | 63 6f 70 79 69 6e 67 20 |ther or |copying |
|00004b30| 66 72 6f 6d 20 6f 6e 65 | 20 70 61 72 74 20 6f 66 |from one| part of|
|00004b40| 20 6d 61 69 6e 20 6d 65 | 6d 6f 72 79 20 74 6f 20 | main me|mory to |
|00004b50| 61 6e 6f 74 68 65 72 2e | 20 20 4d 6f 64 69 66 79 |another.| Modify|
|00004b60| 69 6e 67 20 74 68 65 20 | 73 74 61 6e 64 61 72 64 |ing the |standard|
|00004b70| 20 74 65 73 74 20 74 6f | 20 63 72 65 61 74 65 20 | test to| create |
|00004b80| 74 77 6f 20 77 69 6e 64 | 6f 77 73 20 61 6e 64 20 |two wind|ows and |
|00004b90| 74 77 6f 20 6f 66 66 2d | 73 63 72 65 65 6e 20 70 |two off-|screen p|
|00004ba0| 69 78 65 6c 20 6d 61 70 | 73 d1 61 6c 6c 20 65 69 |ixel map|s.all ei|
|00004bb0| 67 68 74 20 62 69 74 73 | 20 64 65 65 70 20 77 69 |ght bits| deep wi|
|00004bc0| 74 68 20 74 68 65 20 73 | 74 61 6e 64 61 72 64 20 |th the s|tandard |
|00004bd0| 63 6f 6c 6f 72 20 74 61 | 62 6c 65 20 74 68 65 6e |color ta|ble then|
|00004be0| 20 64 6f 69 6e 67 20 65 | 76 65 72 79 20 63 6f 6d | doing e|very com|
|00004bf0| 62 69 6e 61 74 69 6f 6e | 20 6f 66 20 63 6f 70 79 |bination| of copy|
|00004c00| 69 6e 67 20 62 65 74 77 | 65 65 6e 20 6f 66 66 2d |ing betw|een off-|
|00004c10| 73 63 72 65 65 6e 73 2c | 20 62 65 74 77 65 65 6e |screens,| between|
|00004c20| 20 77 69 6e 64 6f 77 73 | 2c 20 61 6e 64 20 62 65 | windows|, and be|
|00004c30| 74 77 65 65 6e 20 6f 66 | 66 2d 73 63 72 65 65 6e |tween of|f-screen|
|00004c40| 73 20 61 6e 64 20 77 69 | 6e 64 6f 77 73 20 70 72 |s and wi|ndows pr|
|00004c50| 6f 64 75 63 65 73 20 74 | 68 65 20 66 6f 6c 6c 6f |oduces t|he follo|
|00004c60| 77 69 6e 67 20 72 65 73 | 75 6c 74 73 3a 0d 09 09 |wing res|ults:...|
|00004c70| 09 09 4f 66 66 2d 73 63 | 72 65 65 6e 20 74 6f 20 |..Off-sc|reen to |
|00004c80| 6f 66 66 2d 73 63 72 65 | 65 6e 3a 09 31 34 37 0d |off-scre|en:.147.|
|00004c90| 09 09 09 09 53 63 72 65 | 65 6e 20 74 6f 20 73 63 |....Scre|en to sc|
|00004ca0| 72 65 65 6e 3a 20 09 09 | 31 38 38 0d 09 09 09 09 |reen: ..|188.....|
|00004cb0| 4f 66 66 2d 73 63 72 65 | 65 6e 20 74 6f 20 73 63 |Off-scre|en to sc|
|00004cc0| 72 65 65 6e 3a 09 09 32 | 30 34 0d 09 09 09 09 53 |reen:..2|04.....S|
|00004cd0| 63 72 65 65 6e 20 74 6f | 20 6f 66 66 2d 73 63 72 |creen to| off-scr|
|00004ce0| 65 65 6e 3a 09 09 32 30 | 31 0d 50 65 72 66 6f 72 |een:..20|1.Perfor|
|00004cf0| 6d 69 6e 67 20 74 68 65 | 20 73 74 61 6e 64 61 72 |ming the| standar|
|00004d00| 64 20 74 65 73 74 20 6f | 6e 20 61 20 4d 61 63 69 |d test o|n a Maci|
|00004d10| 6e 74 6f 73 68 20 49 49 | 66 78 20 72 75 6e 6e 69 |ntosh II|fx runni|
|00004d20| 6e 67 20 53 79 73 74 65 | 6d 20 53 6f 66 74 77 61 |ng Syste|m Softwa|
|00004d30| 72 65 20 36 2e 30 2e 35 | 20 77 69 74 68 20 61 6e |re 6.0.5| with an|
|00004d40| 20 41 70 70 6c 65 20 45 | 78 74 65 6e 64 65 64 20 | Apple E|xtended |
|00004d50| 56 69 64 65 6f 20 43 61 | 72 64 20 79 69 65 6c 64 |Video Ca|rd yield|
|00004d60| 73 20 61 20 72 65 73 75 | 6c 74 20 6f 66 20 31 35 |s a resu|lt of 15|
|00004d70| 33 20 74 69 63 6b 73 2c | 20 77 68 69 63 68 20 69 |3 ticks,| which i|
|00004d80| 73 20 6e 6f 74 20 74 6f | 6f 20 73 68 61 62 62 79 |s not to|o shabby|
|00004d90| 20 63 6f 6e 73 69 64 65 | 72 69 6e 67 20 74 68 61 | conside|ring tha|
|00004da0| 74 20 74 68 65 20 74 72 | 61 6e 73 66 65 72 20 69 |t the tr|ansfer i|
|00004db0| 73 20 73 74 69 6c 6c 20 | 67 6f 69 6e 67 20 74 68 |s still |going th|
|00004dc0| 72 6f 75 67 68 20 4e 75 | 42 75 73 2e 0d 44 65 70 |rough Nu|Bus..Dep|
|00004dd0| 74 68 20 6f 66 20 50 69 | 78 65 6c 20 4d 61 70 73 |th of Pi|xel Maps|
|00004de0| 0d 54 68 69 73 20 66 61 | 63 74 6f 72 20 69 73 20 |.This fa|ctor is |
|00004df0| 70 72 65 74 74 79 20 6f | 62 76 69 6f 75 73 20 61 |pretty o|bvious a|
|00004e00| 6e 64 20 69 73 20 73 6f | 72 74 20 6f 66 20 73 69 |nd is so|rt of si|
|00004e10| 6d 69 6c 61 72 20 74 6f | 20 74 68 65 20 65 66 66 |milar to| the eff|
|00004e20| 65 63 74 20 6f 66 20 74 | 68 65 20 64 69 6d 65 6e |ect of t|he dimen|
|00004e30| 73 69 6f 6e 73 20 6f 66 | 20 74 68 65 20 63 6f 70 |sions of| the cop|
|00004e40| 69 65 64 20 61 72 65 61 | 3a 20 20 74 68 65 20 6d |ied area|: the m|
|00004e50| 6f 72 65 20 62 69 74 73 | 20 70 65 72 20 70 69 78 |ore bits| per pix|
|00004e60| 65 6c 20 74 68 65 72 65 | 20 61 72 65 20 69 6e 20 |el there| are in |
|00004e70| 74 68 65 20 70 69 78 65 | 6c 20 6d 61 70 20 74 6f |the pixe|l map to|
|00004e80| 20 63 6f 70 79 2c 20 74 | 68 65 20 6d 6f 72 65 20 | copy, t|he more |
|00004e90| 6d 65 6d 6f 72 79 20 74 | 68 61 74 20 5f 43 6f 70 |memory t|hat _Cop|
|00004ea0| 79 42 69 74 73 20 68 61 | 73 20 74 6f 20 6d 6f 76 |yBits ha|s to mov|
|00004eb0| 65 20 61 6e 64 20 74 68 | 65 20 6c 6f 6e 67 65 72 |e and th|e longer|
|00004ec0| 20 69 74 20 74 61 6b 65 | 73 20 74 6f 20 67 65 74 | it take|s to get|
|00004ed0| 20 74 68 65 20 6a 6f 62 | 20 64 6f 6e 65 2c 20 61 | the job| done, a|
|00004ee0| 73 73 75 6d 69 6e 67 20 | 74 68 61 74 20 74 68 65 |ssuming |that the|
|00004ef0| 20 73 6f 75 72 63 65 20 | 61 6e 64 20 64 65 73 74 | source |and dest|
|00004f00| 69 6e 61 74 69 6f 6e 20 | 70 69 78 65 6c 20 6d 61 |ination |pixel ma|
|00004f10| 70 73 20 68 61 76 65 20 | 74 68 65 20 73 61 6d 65 |ps have |the same|
|00004f20| 20 64 65 70 74 68 2e 20 | 20 54 6f 20 6d 61 6b 65 | depth. | To make|
|00004f30| 20 5f 43 6f 70 79 42 69 | 74 73 20 61 73 20 66 61 | _CopyBi|ts as fa|
|00004f40| 73 74 20 61 73 20 70 6f | 73 73 69 62 6c 65 2c 20 |st as po|ssible, |
|00004f50| 6d 61 6b 65 20 73 75 72 | 65 20 74 68 65 20 70 69 |make sur|e the pi|
|00004f60| 78 65 6c 20 6d 61 70 73 | 20 61 72 65 20 61 73 20 |xel maps| are as |
|00004f70| 73 68 61 6c 6c 6f 77 20 | 61 73 20 70 6f 73 73 69 |shallow |as possi|
|00004f80| 62 6c 65 2e 0d 49 66 20 | 5f 43 6f 70 79 42 69 74 |ble..If |_CopyBit|
|00004f90| 73 20 68 61 73 20 74 6f | 20 63 6f 70 79 20 74 6f |s has to| copy to|
|00004fa0| 20 61 20 70 69 78 65 6c | 20 6d 61 70 20 74 68 61 | a pixel| map tha|
|00004fb0| 74 20 68 61 73 20 61 20 | 64 69 66 66 65 72 65 6e |t has a |differen|
|00004fc0| 74 20 64 65 70 74 68 20 | 66 72 6f 6d 20 74 68 65 |t depth |from the|
|00004fd0| 20 73 6f 75 72 63 65 20 | 70 69 78 65 6c 20 6d 61 | source |pixel ma|
|00004fe0| 70 2c 20 74 68 65 20 72 | 65 6c 61 74 69 6f 6e 73 |p, the r|elations|
|00004ff0| 68 69 70 20 62 65 74 77 | 65 65 6e 20 73 70 65 65 |hip betw|een spee|
|00005000| 64 20 61 6e 64 20 64 65 | 70 74 68 20 62 65 63 6f |d and de|pth beco|
|00005010| 6d 65 73 20 6d 6f 72 65 | 20 63 6f 6d 70 6c 69 63 |mes more| complic|
|00005020| 61 74 65 64 2e 20 20 54 | 68 65 72 65 20 69 73 20 |ated. T|here is |
|00005030| 61 20 74 72 61 64 65 6f | 66 66 20 62 65 74 77 65 |a tradeo|ff betwe|
|00005040| 65 6e 20 74 68 65 20 74 | 69 6d 65 20 74 61 6b 65 |en the t|ime take|
|00005050| 6e 20 74 6f 20 63 68 61 | 6e 67 65 20 74 68 65 20 |n to cha|nge the |
|00005060| 64 65 70 74 68 20 6f 66 | 20 61 6e 20 69 6d 61 67 |depth of| an imag|
|00005070| 65 20 61 6e 64 20 74 68 | 65 20 61 62 73 6f 6c 75 |e and th|e absolu|
|00005080| 74 65 20 61 6d 6f 75 6e | 74 20 6f 66 20 64 61 74 |te amoun|t of dat|
|00005090| 61 20 74 68 61 74 20 68 | 61 73 20 74 6f 20 62 65 |a that h|as to be|
|000050a0| 20 70 72 6f 63 65 73 73 | 65 64 2e 20 20 43 6f 70 | process|ed. Cop|
|000050b0| 79 69 6e 67 20 66 72 6f | 6d 20 61 20 31 2d 62 69 |ying fro|m a 1-bi|
|000050c0| 74 20 64 65 65 70 20 70 | 69 78 65 6c 20 6d 61 70 |t deep p|ixel map|
|000050d0| 20 74 6f 20 61 20 33 32 | 2d 62 69 74 20 64 65 65 | to a 32|-bit dee|
|000050e0| 70 20 70 69 78 65 6c 20 | 6d 61 70 20 69 73 20 6e |p pixel |map is n|
|000050f0| 6f 74 20 74 68 61 74 20 | 73 6c 6f 77 20 62 65 63 |ot that |slow bec|
|00005100| 61 75 73 65 20 74 68 65 | 20 61 6d 6f 75 6e 74 20 |ause the| amount |
|00005110| 6f 66 20 69 6d 61 67 65 | 20 64 61 74 61 20 69 6e |of image| data in|
|00005120| 20 74 68 65 20 31 2d 62 | 69 74 20 64 65 65 70 20 | the 1-b|it deep |
|00005130| 70 69 78 65 6c 20 6d 61 | 70 20 69 73 20 73 6f 20 |pixel ma|p is so |
|00005140| 73 6d 61 6c 6c 2e 0d 4d | 6f 64 69 66 79 69 6e 67 |small..M|odifying|
|00005150| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 74 65 | the sta|ndard te|
|00005160| 73 74 20 74 6f 20 74 72 | 61 6e 73 66 65 72 20 61 |st to tr|ansfer a|
|00005170| 20 66 6f 75 72 2d 62 69 | 74 20 64 65 65 70 20 70 | four-bi|t deep p|
|00005180| 69 78 65 6c 20 6d 61 70 | 20 74 6f 20 61 6e 6f 74 |ixel map| to anot|
|00005190| 68 65 72 20 66 6f 75 72 | 2d 62 69 74 20 64 65 65 |her four|-bit dee|
|000051a0| 70 20 70 69 78 65 6c 20 | 6d 61 70 20 70 72 6f 64 |p pixel |map prod|
|000051b0| 75 63 65 73 20 61 20 72 | 65 73 75 6c 74 20 6f 66 |uces a r|esult of|
|000051c0| 20 37 38 20 74 69 63 6b | 73 2e 0d 43 6f 6c 6f 72 | 78 tick|s..Color|
|000051d0| 20 4d 61 70 70 69 6e 67 | 0d 43 6f 6c 6f 72 20 51 | Mapping|.Color Q|
|000051e0| 75 69 63 6b 44 72 61 77 | 20 65 78 70 65 63 74 73 |uickDraw| expects|
|000051f0| 20 61 20 63 6f 6c 6f 72 | 20 74 61 62 6c 65 20 61 | a color| table a|
|00005200| 74 74 61 63 68 65 64 20 | 74 6f 20 65 76 65 72 79 |ttached |to every|
|00005210| 20 69 6e 64 65 78 65 64 | 20 70 69 78 65 6c 20 6d | indexed| pixel m|
|00005220| 61 70 2e 20 20 43 6f 6c | 6f 72 20 74 61 62 6c 65 |ap. Col|or table|
|00005230| 73 20 73 70 65 63 69 66 | 79 20 77 68 61 74 20 63 |s specif|y what c|
|00005240| 6f 6c 6f 72 20 65 61 63 | 68 20 70 69 78 65 6c 20 |olor eac|h pixel |
|00005250| 76 61 6c 75 65 20 69 6e | 20 74 68 65 20 70 69 78 |value in| the pix|
|00005260| 65 6c 20 6d 61 70 20 72 | 65 70 72 65 73 65 6e 74 |el map r|epresent|
|00005270| 73 2e 20 20 57 68 65 6e | 20 61 6e 20 61 70 70 6c |s. When| an appl|
|00005280| 69 63 61 74 69 6f 6e 20 | 63 61 6c 6c 73 20 5f 43 |ication |calls _C|
|00005290| 6f 70 79 42 69 74 73 20 | 74 6f 20 63 6f 70 79 20 |opyBits |to copy |
|000052a0| 61 20 70 69 78 65 6c 20 | 6d 61 70 20 69 6e 74 6f |a pixel |map into|
|000052b0| 20 61 6e 6f 74 68 65 72 | 20 70 69 78 65 6c 20 6d | another| pixel m|
|000052c0| 61 70 2c 20 5f 43 6f 70 | 79 42 69 74 73 20 72 65 |ap, _Cop|yBits re|
|000052d0| 70 72 6f 64 75 63 65 73 | 20 74 68 65 20 63 6f 6c |produces| the col|
|000052e0| 6f 72 73 20 6f 66 20 74 | 68 65 20 69 6d 61 67 65 |ors of t|he image|
|000052f0| 20 69 6e 20 74 68 65 20 | 73 6f 75 72 63 65 20 70 | in the |source p|
|00005300| 69 78 65 6c 20 6d 61 70 | 20 61 73 20 63 6c 6f 73 |ixel map| as clos|
|00005310| 65 6c 79 20 61 73 20 70 | 6f 73 73 69 62 6c 65 d1 |ely as p|ossible.|
|00005320| 65 76 65 6e 20 69 66 20 | 74 68 65 20 63 6f 6c 6f |even if |the colo|
|00005330| 72 73 20 61 76 61 69 6c | 61 62 6c 65 20 69 6e 20 |rs avail|able in |
|00005340| 74 68 65 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |the dest|ination |
|00005350| 70 69 78 65 6c 20 6d 61 | 70 20 61 72 65 20 64 69 |pixel ma|p are di|
|00005360| 66 66 65 72 65 6e 74 20 | 74 68 61 6e 20 74 68 6f |fferent |than tho|
|00005370| 73 65 20 61 76 61 69 6c | 61 62 6c 65 20 69 6e 20 |se avail|able in |
|00005380| 74 68 65 20 73 6f 75 72 | 63 65 20 70 69 78 65 6c |the sour|ce pixel|
|00005390| 20 6d 61 70 2e 20 20 54 | 68 69 73 20 72 65 70 72 | map. T|his repr|
|000053a0| 6f 64 75 63 74 69 6f 6e | 20 69 73 20 64 6f 6e 65 |oduction| is done|
|000053b0| 20 74 68 72 6f 75 67 68 | 20 61 20 70 72 6f 63 65 | through| a proce|
|000053c0| 73 73 20 63 61 6c 6c 65 | 64 20 d2 63 6f 6c 6f 72 |ss calle|d .color|
|000053d0| 20 6d 61 70 70 69 6e 67 | 2e d3 0d 57 68 65 6e 20 | mapping|...When |
|000053e0| 63 6f 6c 6f 72 20 6d 61 | 70 70 69 6e 67 20 69 73 |color ma|pping is|
|000053f0| 20 64 6f 6e 65 2c 20 74 | 68 65 20 73 6f 75 72 63 | done, t|he sourc|
|00005400| 65 20 70 69 78 65 6c 20 | 76 61 6c 75 65 73 20 61 |e pixel |values a|
|00005410| 72 65 20 74 72 61 6e 73 | 66 6f 72 6d 65 64 20 69 |re trans|formed i|
|00005420| 6e 74 6f 20 52 47 42 43 | 6f 6c 6f 72 20 72 65 63 |nto RGBC|olor rec|
|00005430| 6f 72 64 73 20 75 73 69 | 6e 67 20 74 68 65 20 73 |ords usi|ng the s|
|00005440| 6f 75 72 63 65 20 70 69 | 78 65 6c 20 6d 61 70 d5 |ource pi|xel map.|
|00005450| 73 20 63 6f 6c 6f 72 20 | 74 61 62 6c 65 2e 20 20 |s color |table. |
|00005460| 54 68 65 73 65 20 52 47 | 42 43 6f 6c 6f 72 20 72 |These RG|BColor r|
|00005470| 65 63 6f 72 64 73 20 61 | 72 65 20 70 61 73 73 65 |ecords a|re passe|
|00005480| 64 20 74 6f 20 5f 43 6f | 6c 6f 72 32 49 6e 64 65 |d to _Co|lor2Inde|
|00005490| 78 20 77 68 69 63 68 20 | 66 69 6e 64 73 20 74 68 |x which |finds th|
|000054a0| 65 20 70 69 78 65 6c 20 | 76 61 6c 75 65 73 20 6f |e pixel |values o|
|000054b0| 66 20 74 68 65 20 63 6c | 6f 73 65 73 74 20 61 76 |f the cl|osest av|
|000054c0| 61 69 6c 61 62 6c 65 20 | 63 6f 6c 6f 72 73 20 69 |ailable |colors i|
|000054d0| 6e 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 47 44 |n the cu|rrent GD|
|000054e0| 65 76 69 63 65 20 70 69 | 78 65 6c 20 6d 61 70 d5 |evice pi|xel map.|
|000054f0| 73 20 63 6f 6c 6f 72 20 | 74 61 62 6c 65 2e 20 20 |s color |table. |
|00005500| 54 68 69 73 20 73 61 6d | 65 20 70 72 6f 63 65 73 |This sam|e proces|
|00005510| 73 20 69 73 20 64 6f 6e | 65 20 77 68 65 6e 20 74 |s is don|e when t|
|00005520| 68 65 20 73 6f 75 72 63 | 65 20 61 6e 64 20 64 65 |he sourc|e and de|
|00005530| 73 74 69 6e 61 74 69 6f | 6e 20 70 69 78 65 6c 20 |stinatio|n pixel |
|00005540| 6d 61 70 73 20 68 61 76 | 65 20 64 69 66 66 65 72 |maps hav|e differ|
|00005550| 69 6e 67 20 64 65 70 74 | 68 73 2e 20 20 54 68 65 |ing dept|hs. The|
|00005560| 20 63 6f 6c 6f 72 20 74 | 61 62 6c 65 20 61 74 74 | color t|able att|
|00005570| 61 63 68 65 64 20 74 6f | 20 74 68 65 20 64 65 73 |ached to| the des|
|00005580| 74 69 6e 61 74 69 6f 6e | 20 70 69 78 65 6c 20 6d |tination| pixel m|
|00005590| 61 70 20 69 73 20 6e 6f | 74 20 75 73 65 64 20 69 |ap is no|t used i|
|000055a0| 6e 20 63 6f 6c 6f 72 20 | 6d 61 70 70 69 6e 67 2e |n color |mapping.|
|000055b0| 20 20 54 68 65 20 63 6f | 6c 6f 72 73 20 61 76 61 | The co|lors ava|
|000055c0| 69 6c 61 62 6c 65 20 69 | 6e 20 74 68 65 20 63 75 |ilable i|n the cu|
|000055d0| 72 72 65 6e 74 20 47 44 | 65 76 69 63 65 20 70 69 |rrent GD|evice pi|
|000055e0| 78 65 6c 20 6d 61 70 d5 | 73 20 63 6f 6c 6f 72 20 |xel map.|s color |
|000055f0| 74 61 62 6c 65 20 61 72 | 65 20 75 73 65 64 20 69 |table ar|e used i|
|00005600| 6e 73 74 65 61 64 2e 20 | 20 53 6f 2c 20 74 68 65 |nstead. | So, the|
|00005610| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 70 69 78 | destina|tion pix|
|00005620| 65 6c 20 6d 61 70 20 6d | 75 73 74 20 68 61 76 65 |el map m|ust have|
|00005630| 20 74 68 65 20 73 61 6d | 65 20 63 6f 6c 6f 72 73 | the sam|e colors|
|00005640| 20 66 6f 72 20 74 68 65 | 20 73 61 6d 65 20 70 69 | for the| same pi|
|00005650| 78 65 6c 20 76 61 6c 75 | 65 73 20 61 73 20 74 68 |xel valu|es as th|
|00005660| 65 20 63 75 72 72 65 6e | 74 20 47 44 65 76 69 63 |e curren|t GDevic|
|00005670| 65 2e 20 20 4f 74 68 65 | 72 77 69 73 65 2c 20 74 |e. Othe|rwise, t|
|00005680| 68 65 20 72 65 73 75 6c | 74 69 6e 67 20 69 6d 61 |he resul|ting ima|
|00005690| 67 65 20 69 6e 20 74 68 | 65 20 64 65 73 74 69 6e |ge in th|e destin|
|000056a0| 61 74 69 6f 6e 20 70 69 | 78 65 6c 20 6d 61 70 20 |ation pi|xel map |
|000056b0| 67 65 74 73 20 74 68 65 | 20 77 72 6f 6e 67 20 63 |gets the| wrong c|
|000056c0| 6f 6c 6f 72 73 2e 20 20 | 53 65 65 20 49 6e 73 69 |olors. |See Insi|
|000056d0| 64 65 20 4d 61 63 69 6e | 74 6f 73 68 2c 20 56 6f |de Macin|tosh, Vo|
|000056e0| 6c 75 6d 65 20 56 2d 31 | 34 31 2c 20 54 68 65 20 |lume V-1|41, The |
|000056f0| 43 6f 6c 6f 72 20 4d 61 | 6e 61 67 65 72 2c 20 66 |Color Ma|nager, f|
|00005700| 6f 72 20 61 20 64 65 73 | 63 72 69 70 74 69 6f 6e |or a des|cription|
|00005710| 20 6f 66 20 5f 43 6f 6c | 6f 72 32 49 6e 64 65 78 | of _Col|or2Index|
|00005720| 2e 20 20 49 74 d5 73 20 | 61 6c 73 6f 20 68 65 6c |. It.s |also hel|
|00005730| 70 66 75 6c 20 74 6f 20 | 72 65 61 64 20 74 68 65 |pful to |read the|
|00005740| 20 d2 49 6e 76 65 72 73 | 65 20 54 61 62 6c 65 73 | .Invers|e Tables|
|00005750| d3 20 73 65 63 74 69 6f | 6e 20 69 6e 20 74 68 65 |. sectio|n in the|
|00005760| 20 73 61 6d 65 20 63 68 | 61 70 74 65 72 20 6f 6e | same ch|apter on|
|00005770| 20 70 61 67 65 20 56 2d | 31 33 37 2e 0d 4e 6f 77 | page V-|137..Now|
|00005780| 2c 20 69 66 20 74 68 65 | 20 73 6f 75 72 63 65 20 |, if the| source |
|00005790| 63 6f 6c 6f 72 20 74 61 | 62 6c 65 20 63 6f 6e 74 |color ta|ble cont|
|000057a0| 61 69 6e 73 20 76 69 72 | 74 75 61 6c 6c 79 20 74 |ains vir|tually t|
|000057b0| 68 65 20 73 61 6d 65 20 | 63 6f 6c 6f 72 73 20 66 |he same |colors f|
|000057c0| 6f 72 20 74 68 65 20 73 | 61 6d 65 20 70 69 78 65 |or the s|ame pixe|
|000057d0| 6c 20 76 61 6c 75 65 73 | 20 61 73 20 74 68 65 20 |l values| as the |
|000057e0| 63 75 72 72 65 6e 74 20 | 47 44 65 76 69 63 65 20 |current |GDevice |
|000057f0| 70 69 78 65 6c 20 6d 61 | 70 d5 73 20 63 6f 6c 6f |pixel ma|p.s colo|
|00005800| 72 20 74 61 62 6c 65 2c | 20 74 68 65 6e 20 61 6e |r table,| then an|
|00005810| 79 20 70 61 72 74 69 63 | 75 6c 61 72 20 70 69 78 |y partic|ular pix|
|00005820| 65 6c 20 76 61 6c 75 65 | 20 68 61 73 20 74 68 65 |el value| has the|
|00005830| 20 73 61 6d 65 20 63 6f | 6c 6f 72 20 72 65 67 61 | same co|lor rega|
|00005840| 72 64 6c 65 73 73 20 6f | 66 20 77 68 65 74 68 65 |rdless o|f whethe|
|00005850| 72 20 69 74 20 69 73 20 | 69 6e 20 74 68 65 20 73 |r it is |in the s|
|00005860| 6f 75 72 63 65 20 6f 72 | 20 64 65 73 74 69 6e 61 |ource or| destina|
|00005870| 74 69 6f 6e 20 70 69 78 | 65 6c 20 6d 61 70 2e 20 |tion pix|el map. |
|00005880| 20 49 6e 20 74 68 69 73 | 20 63 61 73 65 2c 20 63 | In this| case, c|
|00005890| 6f 6c 6f 72 20 6d 61 70 | 70 69 6e 67 20 69 73 20 |olor map|ping is |
|000058a0| 61 20 77 61 73 74 65 20 | 6f 66 20 74 69 6d 65 2c |a waste |of time,|
|000058b0| 20 62 65 63 61 75 73 65 | 20 74 68 65 20 70 69 78 | because| the pix|
|000058c0| 65 6c 73 20 63 61 6e 20 | 62 65 20 63 6f 70 69 65 |els can |be copie|
|000058d0| 64 20 64 69 72 65 63 74 | 6c 79 20 66 72 6f 6d 20 |d direct|ly from |
|000058e0| 74 68 65 20 73 6f 75 72 | 63 65 20 70 69 78 65 6c |the sour|ce pixel|
|000058f0| 20 6d 61 70 20 74 6f 20 | 74 68 65 20 64 65 73 74 | map to |the dest|
|00005900| 69 6e 61 74 69 6f 6e 20 | 70 69 78 65 6c 20 6d 61 |ination |pixel ma|
|00005910| 70 20 77 69 74 68 6f 75 | 74 20 61 20 6c 6f 73 73 |p withou|t a loss|
|00005920| 20 6f 66 20 63 6f 6c 6f | 72 20 66 69 64 65 6c 69 | of colo|r fideli|
|00005930| 74 79 2e 20 20 5f 43 6f | 70 79 42 69 74 73 20 74 |ty. _Co|pyBits t|
|00005940| 61 6b 65 73 20 61 64 76 | 61 6e 74 61 67 65 20 6f |akes adv|antage o|
|00005950| 66 20 74 68 69 73 20 73 | 70 65 63 69 61 6c 20 63 |f this s|pecial c|
|00005960| 61 73 65 20 74 6f 20 79 | 69 65 6c 64 20 73 6f 6d |ase to y|ield som|
|00005970| 65 20 62 69 67 20 73 70 | 65 65 64 20 69 6d 70 72 |e big sp|eed impr|
|00005980| 6f 76 65 6d 65 6e 74 73 | 2e 20 20 48 6f 77 20 69 |ovements|. How i|
|00005990| 73 20 74 68 69 73 20 73 | 70 65 63 69 61 6c 20 63 |s this s|pecial c|
|000059a0| 61 73 65 20 64 65 74 65 | 63 74 65 64 3f 20 20 42 |ase dete|cted? B|
|000059b0| 65 66 6f 72 65 20 74 68 | 69 73 20 71 75 65 73 74 |efore th|is quest|
|000059c0| 69 6f 6e 20 69 73 20 61 | 6e 73 77 65 72 65 64 2c |ion is a|nswered,|
|000059d0| 20 69 74 d5 73 20 75 73 | 65 66 75 6c 20 74 6f 20 | it.s us|eful to |
|000059e0| 75 6e 64 65 72 73 74 61 | 6e 64 20 68 6f 77 20 43 |understa|nd how C|
|000059f0| 6f 6c 6f 72 20 51 75 69 | 63 6b 44 72 61 77 20 75 |olor Qui|ckDraw u|
|00005a00| 73 65 73 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 73 |ses colo|r tables|
|00005a10| 2e 0d 54 68 65 20 63 74 | 53 65 65 64 20 46 69 65 |..The ct|Seed Fie|
|00005a20| 6c 64 0d 54 68 65 20 66 | 69 72 73 74 20 66 69 65 |ld.The f|irst fie|
|00005a30| 6c 64 20 69 6e 20 61 20 | 63 6f 6c 6f 72 20 74 61 |ld in a |color ta|
|00005a40| 62 6c 65 20 69 73 20 74 | 68 65 20 63 74 53 65 65 |ble is t|he ctSee|
|00005a50| 64 20 66 69 65 6c 64 2e | 20 20 54 68 69 73 20 4c |d field.| This L|
|00005a60| 6f 6e 67 49 6e 74 20 63 | 61 6e 20 62 65 20 74 68 |ongInt c|an be th|
|00005a70| 6f 75 67 68 74 20 6f 66 | 20 61 73 20 74 68 65 20 |ought of| as the |
|00005a80| 63 6f 6c 6f 72 20 74 61 | 62 6c 65 d5 73 20 76 65 |color ta|ble.s ve|
|00005a90| 72 73 69 6f 6e 20 6f 66 | 20 74 68 65 20 73 63 72 |rsion of| the scr|
|00005aa0| 61 70 43 6f 75 6e 74 20 | 66 69 65 6c 64 20 6f 66 |apCount |field of|
|00005ab0| 20 74 68 65 20 64 65 73 | 6b 20 73 63 72 61 70 2e | the des|k scrap.|
|00005ac0| 20 20 57 68 65 6e 65 76 | 65 72 20 61 6e 20 61 70 | Whenev|er an ap|
|00005ad0| 70 6c 69 63 61 74 69 6f | 6e 20 63 61 6c 6c 73 20 |plicatio|n calls |
|00005ae0| 5f 5a 65 72 6f 53 63 72 | 61 70 2c 20 74 68 65 20 |_ZeroScr|ap, the |
|00005af0| 64 65 73 6b 20 73 63 72 | 61 70 d5 73 20 73 63 72 |desk scr|ap.s scr|
|00005b00| 61 70 43 6f 75 6e 74 20 | 69 73 20 63 68 61 6e 67 |apCount |is chang|
|00005b10| 65 64 2e 20 20 41 6e 20 | 61 70 70 6c 69 63 61 74 |ed. An |applicat|
|00005b20| 69 6f 6e 20 63 61 6e 20 | 74 65 6c 6c 20 74 68 61 |ion can |tell tha|
|00005b30| 74 20 74 68 65 20 64 65 | 73 6b 20 73 63 72 61 70 |t the de|sk scrap|
|00005b40| 20 68 61 73 20 63 68 61 | 6e 67 65 64 20 62 79 20 | has cha|nged by |
|00005b50| 63 68 65 63 6b 69 6e 67 | 20 74 6f 20 73 65 65 20 |checking| to see |
|00005b60| 69 66 20 74 68 65 20 73 | 63 72 61 70 43 6f 75 6e |if the s|crapCoun|
|00005b70| 74 20 68 61 73 20 63 68 | 61 6e 67 65 64 2e 20 20 |t has ch|anged. |
|00005b80| 53 69 6d 69 6c 61 72 6c | 79 2c 20 77 68 65 6e 65 |Similarl|y, whene|
|00005b90| 76 65 72 20 74 68 65 20 | 63 6f 6e 74 65 6e 74 73 |ver the |contents|
|00005ba0| 20 6f 66 20 61 20 63 6f | 6c 6f 72 20 74 61 62 6c | of a co|lor tabl|
|00005bb0| 65 20 61 72 65 20 63 68 | 61 6e 67 65 64 20 69 6e |e are ch|anged in|
|00005bc0| 20 61 6e 79 20 77 61 79 | 2c 20 74 68 65 20 63 74 | any way|, the ct|
|00005bd0| 53 65 65 64 20 66 69 65 | 6c 64 20 73 68 6f 75 6c |Seed fie|ld shoul|
|00005be0| 64 20 62 65 20 63 68 61 | 6e 67 65 64 20 74 6f 20 |d be cha|nged to |
|00005bf0| 69 6e 64 69 63 61 74 65 | 20 74 6f 20 61 6e 79 6f |indicate| to anyo|
|00005c00| 6e 65 20 75 73 69 6e 67 | 20 74 68 61 74 20 63 6f |ne using| that co|
|00005c10| 6c 6f 72 20 74 61 62 6c | 65 20 74 68 61 74 20 69 |lor tabl|e that i|
|00005c20| 74 20 68 61 73 20 62 65 | 65 6e 20 6d 6f 64 69 66 |t has be|en modif|
|00005c30| 69 65 64 2e 0d 41 64 64 | 69 74 69 6f 6e 61 6c 6c |ied..Add|itionall|
|00005c40| 79 2c 20 43 6f 6c 6f 72 | 20 51 75 69 63 6b 44 72 |y, Color| QuickDr|
|00005c50| 61 77 20 6f 66 74 65 6e | 20 75 73 65 73 20 74 68 |aw often| uses th|
|00005c60| 65 20 63 74 53 65 65 64 | 20 61 73 20 61 20 66 61 |e ctSeed| as a fa|
|00005c70| 73 74 20 63 68 65 63 6b | 20 66 6f 72 20 63 6f 6c |st check| for col|
|00005c80| 6f 72 20 74 61 62 6c 65 | 20 65 71 75 61 6c 69 74 |or table| equalit|
|00005c90| 79 2e 20 20 49 66 20 74 | 77 6f 20 63 6f 6c 6f 72 |y. If t|wo color|
|00005ca0| 20 74 61 62 6c 65 73 20 | 68 61 76 65 20 74 68 65 | tables |have the|
|00005cb0| 20 73 61 6d 65 20 63 74 | 53 65 65 64 2c 20 74 68 | same ct|Seed, th|
|00005cc0| 65 6e 20 43 6f 6c 6f 72 | 20 51 75 69 63 6b 44 72 |en Color| QuickDr|
|00005cd0| 61 77 20 6f 66 74 65 6e | 20 61 73 73 75 6d 65 73 |aw often| assumes|
|00005ce0| 20 74 68 61 74 20 74 68 | 65 69 72 20 63 6f 6e 74 | that th|eir cont|
|00005cf0| 65 6e 74 73 20 61 72 65 | 20 65 71 75 69 76 61 6c |ents are| equival|
|00005d00| 65 6e 74 2e 0d 41 66 74 | 65 72 20 63 72 65 61 74 |ent..Aft|er creat|
|00005d10| 69 6e 67 20 61 20 6e 65 | 77 20 63 6f 6c 6f 72 20 |ing a ne|w color |
|00005d20| 74 61 62 6c 65 2c 20 61 | 6e 20 61 70 70 6c 69 63 |table, a|n applic|
|00005d30| 61 74 69 6f 6e 20 68 61 | 73 20 74 6f 20 67 65 74 |ation ha|s to get|
|00005d40| 20 61 20 76 61 6c 69 64 | 20 76 61 6c 75 65 20 66 | a valid| value f|
|00005d50| 6f 72 20 74 68 65 20 63 | 74 53 65 65 64 20 66 69 |or the c|tSeed fi|
|00005d60| 65 6c 64 2c 20 61 6e 64 | 20 69 74 20 63 61 6e 20 |eld, and| it can |
|00005d70| 64 6f 20 73 6f 20 77 69 | 74 68 20 74 68 65 20 5f |do so wi|th the _|
|00005d80| 47 65 74 43 54 53 65 65 | 64 20 72 6f 75 74 69 6e |GetCTSee|d routin|
|00005d90| 65 2e 20 20 54 68 69 73 | 20 72 6f 75 74 69 6e 65 |e. This| routine|
|00005da0| 20 67 65 6e 65 72 61 74 | 65 73 20 61 20 76 61 6c | generat|es a val|
|00005db0| 69 64 20 63 74 53 65 65 | 64 20 76 61 6c 75 65 20 |id ctSee|d value |
|00005dc0| 73 75 69 74 61 62 6c 65 | 20 66 6f 72 20 61 20 6e |suitable| for a n|
|00005dd0| 65 77 20 63 6f 6c 6f 72 | 20 74 61 62 6c 65 2e 20 |ew color| table. |
|00005de0| 20 53 65 65 20 49 6e 73 | 69 64 65 20 4d 61 63 69 | See Ins|ide Maci|
|00005df0| 6e 74 6f 73 68 2c 20 56 | 6f 6c 75 6d 65 20 56 2d |ntosh, V|olume V-|
|00005e00| 31 34 33 2c 20 54 68 65 | 20 43 6f 6c 6f 72 20 4d |143, The| Color M|
|00005e10| 61 6e 61 67 65 72 2c 20 | 66 6f 72 20 61 20 64 65 |anager, |for a de|
|00005e20| 73 63 72 69 70 74 69 6f | 6e 20 6f 66 20 5f 47 65 |scriptio|n of _Ge|
|00005e30| 74 43 54 53 65 65 64 2e | 0d 53 79 73 74 65 6d 20 |tCTSeed.|.System |
|00005e40| 53 6f 66 74 77 61 72 65 | 20 37 2e 30 20 61 6e 64 |Software| 7.0 and|
|00005e50| 20 33 32 2d 42 69 74 20 | 51 75 69 63 6b 44 72 61 | 32-Bit |QuickDra|
|00005e60| 77 20 65 61 63 68 20 6f | 66 66 65 72 20 61 20 72 |w each o|ffer a r|
|00005e70| 6f 75 74 69 6e 65 20 63 | 61 6c 6c 65 64 20 5f 43 |outine c|alled _C|
|00005e80| 54 61 62 43 68 61 6e 67 | 65 64 20 77 68 69 63 68 |TabChang|ed which|
|00005e90| 20 73 68 6f 75 6c 64 20 | 62 65 20 63 61 6c 6c 65 | should |be calle|
|00005ea0| 64 20 61 66 74 65 72 20 | 61 20 63 6f 6c 6f 72 20 |d after |a color |
|00005eb0| 74 61 62 6c 65 20 69 73 | 20 6d 6f 64 69 66 69 65 |table is| modifie|
|00005ec0| 64 2e 20 20 49 74 20 74 | 61 6b 65 73 20 61 20 68 |d. It t|akes a h|
|00005ed0| 61 6e 64 6c 65 20 74 6f | 20 74 68 65 20 63 68 61 |andle to| the cha|
|00005ee0| 6e 67 65 64 20 63 6f 6c | 6f 72 20 74 61 62 6c 65 |nged col|or table|
|00005ef0| 20 61 73 20 61 20 70 61 | 72 61 6d 65 74 65 72 2e | as a pa|rameter.|
|00005f00| 20 20 49 66 20 74 68 65 | 20 5f 43 54 61 62 43 68 | If the| _CTabCh|
|00005f10| 61 6e 67 65 64 20 72 6f | 75 74 69 6e 65 20 69 73 |anged ro|utine is|
|00005f20| 20 6e 6f 74 20 61 76 61 | 69 6c 61 62 6c 65 2c 20 | not ava|ilable, |
|00005f30| 74 68 65 6e 20 74 68 65 | 20 61 70 70 6c 69 63 61 |then the| applica|
|00005f40| 74 69 6f 6e 20 73 68 6f | 75 6c 64 20 69 6e 73 74 |tion sho|uld inst|
|00005f50| 65 61 64 20 63 68 61 6e | 67 65 20 63 74 53 65 65 |ead chan|ge ctSee|
|00005f60| 64 20 74 6f 20 61 20 64 | 69 66 66 65 72 65 6e 74 |d to a d|ifferent|
|00005f70| 20 76 61 6c 69 64 20 76 | 61 6c 75 65 20 62 79 20 | valid v|alue by |
|00005f80| 63 61 6c 6c 69 6e 67 20 | 5f 47 65 74 43 54 53 65 |calling |_GetCTSe|
|00005f90| 65 64 20 61 6e 64 20 61 | 73 73 69 67 6e 69 6e 67 |ed and a|ssigning|
|00005fa0| 20 74 68 65 20 72 65 73 | 75 6c 74 20 74 6f 20 63 | the res|ult to c|
|00005fb0| 74 53 65 65 64 2c 20 6a | 75 73 74 20 6c 69 6b 65 |tSeed, j|ust like|
|00005fc0| 20 69 74 d5 73 20 64 6f | 6e 65 20 77 68 65 6e 20 | it.s do|ne when |
|00005fd0| 74 68 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |the appl|ication |
|00005fe0| 63 72 65 61 74 65 73 20 | 61 20 6e 65 77 20 63 6f |creates |a new co|
|00005ff0| 6c 6f 72 20 74 61 62 6c | 65 2e 20 20 59 6f 75 20 |lor tabl|e. You |
|00006000| 6d 75 73 74 20 75 73 65 | 20 65 69 74 68 65 72 20 |must use| either |
|00006010| 6f 6e 65 20 6f 66 20 74 | 68 65 73 65 20 6d 65 74 |one of t|hese met|
|00006020| 68 6f 64 73 20 74 6f 20 | 74 65 6c 6c 20 43 6f 6c |hods to |tell Col|
|00006030| 6f 72 20 51 75 69 63 6b | 44 72 61 77 20 74 68 61 |or Quick|Draw tha|
|00006040| 74 20 74 68 65 20 63 6f | 6c 6f 72 20 74 61 62 6c |t the co|lor tabl|
|00006050| 65 20 68 61 73 20 63 68 | 61 6e 67 65 64 2c 20 6f |e has ch|anged, o|
|00006060| 72 20 65 6c 73 65 20 74 | 68 65 20 6d 6f 64 69 66 |r else t|he modif|
|00006070| 69 65 64 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 20 |ied colo|r table |
|00006080| 63 6f 75 6c 64 20 62 65 | 20 63 6f 6e 66 75 73 65 |could be| confuse|
|00006090| 64 20 77 69 74 68 20 74 | 68 65 20 6f 6c 64 20 63 |d with t|he old c|
|000060a0| 6f 6c 6f 72 20 74 61 62 | 6c 65 2c 20 6f 72 20 77 |olor tab|le, or w|
|000060b0| 69 74 68 20 73 6f 6d 65 | 20 6f 74 68 65 72 20 63 |ith some| other c|
|000060c0| 6f 6c 6f 72 20 74 61 62 | 6c 65 d1 74 68 69 73 20 |olor tab|le.this |
|000060d0| 69 73 20 65 73 70 65 63 | 69 61 6c 6c 79 20 63 72 |is espec|ially cr|
|000060e0| 69 74 69 63 61 6c 20 69 | 66 20 61 6e 20 38 a5 32 |itical i|f an 8.2|
|000060f0| 34 20 47 43 20 63 61 72 | 64 20 69 73 20 62 65 69 |4 GC car|d is bei|
|00006100| 6e 67 20 75 73 65 64 2e | 20 20 53 65 65 20 74 68 |ng used.| See th|
|00006110| 65 20 33 32 2d 42 69 74 | 20 51 75 69 63 6b 44 72 |e 32-Bit| QuickDr|
|00006120| 61 77 20 44 65 76 65 6c | 6f 70 65 72 73 d5 20 4e |aw Devel|opers. N|
|00006130| 6f 74 65 73 20 66 6f 72 | 20 64 65 74 61 69 6c 73 |otes for| details|
|00006140| 20 61 62 6f 75 74 20 74 | 68 65 20 5f 43 54 61 62 | about t|he _CTab|
|00006150| 43 68 61 6e 67 65 64 20 | 72 6f 75 74 69 6e 65 2e |Changed |routine.|
|00006160| 0d 54 68 65 20 63 74 46 | 6c 61 67 73 20 46 69 65 |.The ctF|lags Fie|
|00006170| 6c 64 0d 54 68 65 20 63 | 74 46 6c 61 67 73 20 66 |ld.The c|tFlags f|
|00006180| 69 65 6c 64 20 69 73 20 | 75 73 65 64 20 61 73 20 |ield is |used as |
|00006190| 61 20 73 65 74 20 6f 66 | 20 66 6c 61 67 73 20 74 |a set of| flags t|
|000061a0| 68 61 74 20 69 6e 64 69 | 63 61 74 65 20 73 6f 6d |hat indi|cate som|
|000061b0| 65 20 63 68 61 72 61 63 | 74 65 72 69 73 74 69 63 |e charac|teristic|
|000061c0| 73 20 6f 66 20 74 68 65 | 20 63 6f 6c 6f 72 20 74 |s of the| color t|
|000061d0| 61 62 6c 65 2e 20 20 43 | 75 72 72 65 6e 74 6c 79 |able. C|urrently|
|000061e0| 2c 20 6f 6e 6c 79 20 74 | 68 65 20 74 6f 70 20 74 |, only t|he top t|
|000061f0| 77 6f 20 62 69 74 73 20 | 6f 66 20 63 74 46 6c 61 |wo bits |of ctFla|
|00006200| 67 73 20 61 72 65 20 6f | 66 20 61 6e 79 20 69 6e |gs are o|f any in|
|00006210| 74 65 72 65 73 74 20 74 | 6f 20 64 65 76 65 6c 6f |terest t|o develo|
|00006220| 70 65 72 73 2e 20 20 54 | 68 65 20 6d 6f 73 74 20 |pers. T|he most |
|00006230| 73 69 67 6e 69 66 69 63 | 61 6e 74 20 62 69 74 20 |signific|ant bit |
|00006240| 6f 66 20 63 74 46 6c 61 | 67 73 20 28 62 69 74 20 |of ctFla|gs (bit |
|00006250| 31 35 29 20 69 6e 64 69 | 63 61 74 65 73 20 77 68 |15) indi|cates wh|
|00006260| 65 74 68 65 72 20 74 68 | 65 20 63 6f 6c 6f 72 20 |ether th|e color |
|00006270| 74 61 62 6c 65 20 69 73 | 20 61 20 73 65 71 75 65 |table is| a seque|
|00006280| 6e 74 69 61 6c 20 63 6f | 6c 6f 72 20 74 61 62 6c |ntial co|lor tabl|
|00006290| 65 20 6f 72 20 61 6e 20 | 69 6e 64 65 78 65 64 20 |e or an |indexed |
|000062a0| 63 6f 6c 6f 72 20 74 61 | 62 6c 65 2e 20 20 42 69 |color ta|ble. Bi|
|000062b0| 74 20 31 34 20 69 6e 64 | 69 63 61 74 65 73 20 74 |t 14 ind|icates t|
|000062c0| 68 61 74 20 74 68 65 20 | 63 6f 6c 6f 72 20 74 61 |hat the |color ta|
|000062d0| 62 6c 65 20 69 73 20 61 | 20 73 70 65 63 69 61 6c |ble is a| special|
|000062e0| 20 6b 69 6e 64 20 6f 66 | 20 73 65 71 75 65 6e 74 | kind of| sequent|
|000062f0| 69 61 6c 20 74 61 62 6c | 65 20 69 66 20 69 74 20 |ial tabl|e if it |
|00006300| 69 73 20 73 65 74 2e 20 | 20 49 6e 20 74 68 65 73 |is set. | In thes|
|00006310| 65 20 6b 69 6e 64 73 20 | 6f 66 20 63 6f 6c 6f 72 |e kinds |of color|
|00006320| 20 74 61 62 6c 65 73 2c | 20 74 68 65 20 76 61 6c | tables,| the val|
|00006330| 75 65 20 66 69 65 6c 64 | 73 20 69 6e 64 69 63 61 |ue field|s indica|
|00006340| 74 65 20 61 20 70 61 6c | 65 74 74 65 20 65 6e 74 |te a pal|ette ent|
|00006350| 72 79 20 69 6e 20 74 68 | 65 20 64 65 73 74 69 6e |ry in th|e destin|
|00006360| 61 74 69 6f 6e 20 77 69 | 6e 64 6f 77 d5 73 20 70 |ation wi|ndow.s p|
|00006370| 61 6c 65 74 74 65 2e 20 | 20 53 65 65 20 74 68 65 |alette. | See the|
|00006380| 20 50 61 6c 65 74 74 65 | 20 4d 61 6e 61 67 65 72 | Palette| Manager|
|00006390| 20 73 65 63 74 69 6f 6e | 20 6f 66 20 74 68 65 20 | section| of the |
|000063a0| 33 32 2d 42 69 74 20 51 | 75 69 63 6b 44 72 61 77 |32-Bit Q|uickDraw|
|000063b0| 20 44 65 76 65 6c 6f 70 | 65 72 73 d5 20 4e 6f 74 | Develop|ers. Not|
|000063c0| 65 73 20 66 6f 72 20 61 | 20 64 69 73 63 75 73 73 |es for a| discuss|
|000063d0| 69 6f 6e 20 61 62 6f 75 | 74 20 74 68 69 73 20 63 |ion abou|t this c|
|000063e0| 61 70 61 62 69 6c 69 74 | 79 2e 0d 53 65 71 75 65 |apabilit|y..Seque|
|000063f0| 6e 74 69 61 6c 20 43 6f | 6c 6f 72 20 54 61 62 6c |ntial Co|lor Tabl|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.